Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
Among.cs
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 using System;
18 namespace SF.Snowball
19 {
20 
21  public class Among
22  {
23  public Among(System.String s, int substring_i, int result, System.String methodname, SnowballProgram methodobject)
24  {
25  this.s_size = s.Length;
26  this.s = s;
27  this.substring_i = substring_i;
28  this.result = result;
29  this.methodobject = methodobject;
30  if (methodname.Length == 0)
31  {
32  this.method = null;
33  }
34  else
35  {
36  try
37  {
38  this.method = methodobject.GetType().GetMethod(methodname, System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.DeclaredOnly, null, new System.Type[0], null);
39  }
40  catch (System.MethodAccessException)
41  {
42  // FIXME - debug message
43  this.method = null;
44  }
45  }
46  }
47 
48  public int s_size; /* search string */
49  public System.String s; /* search string */
50  public int substring_i; /* index to longest matching substring */
51  public int result; /* result of the lookup */
52  public System.Reflection.MethodInfo method; /* method to use if substring matches */
53  public SnowballProgram methodobject; /* object to invoke method on */
54  }
55 
56 }