예제 #1
0
 /// <summary>Construct the named stemming filter.
 ///
 /// </summary>
 /// <param name="input">the input tokens to stem
 /// </param>
 /// <param name="name">the name of a stemmer
 /// </param>
 public SnowballFilter(TokenStream input, System.String name) : base(input)
 {
     try
     {
         System.Type stemClass = System.Type.GetType("SF.Snowball.Ext." + name + "Stemmer");
         stemmer = (SnowballProgram)System.Activator.CreateInstance(stemClass);
     }
     catch (System.Exception e)
     {
         throw new System.SystemException(e.ToString());
     }
     termAtt = AddAttribute <ITermAttribute>();
 }
예제 #2
0
		/// <summary>Construct the named stemming filter.
		/// 
		/// </summary>
        /// <param name="input">the input tokens to stem
		/// </param>
		/// <param name="name">the name of a stemmer
		/// </param>
		public SnowballFilter(TokenStream input, System.String name) : base(input)
		{
			try
			{
				System.Type stemClass = System.Type.GetType("SF.Snowball.Ext." + name + "Stemmer");
				stemmer = (SnowballProgram) System.Activator.CreateInstance(stemClass);
			}
			catch (System.Exception e)
			{
				throw new System.SystemException(e.ToString());
			}
		    termAtt = AddAttribute<ITermAttribute>();
		}
예제 #3
0
		/// <summary>Construct the named stemming filter.
		/// 
		/// </summary>
		/// <param name="in">the input tokens to stem
		/// </param>
		/// <param name="name">the name of a stemmer
		/// </param>
		public SnowballFilter(TokenStream in_Renamed, System.String name) : base(in_Renamed)
		{
			try
			{
				System.Type stemClass = System.Type.GetType("SF.Snowball.Ext." + name + "Stemmer");
				stemmer = (SnowballProgram) System.Activator.CreateInstance(stemClass);
				// why doesn't the SnowballProgram class have an (abstract?) stem method?
				stemMethod = stemClass.GetMethod("Stem", (new System.Type[0] == null) ? new System.Type[0] : (System.Type[]) new System.Type[0]);
			}
			catch (System.Exception e)
			{
				throw new System.SystemException(e.ToString());
			}
		}
예제 #4
0
 /// <summary>Construct the named stemming filter.
 ///
 /// </summary>
 /// <param name="in">the input tokens to stem
 /// </param>
 /// <param name="name">the name of a stemmer
 /// </param>
 public SnowballFilter(TokenStream in_Renamed, System.String name) : base(in_Renamed)
 {
     try
     {
         System.Type stemClass = System.Type.GetType("SF.Snowball.Ext." + name + "Stemmer");
         stemmer = (SnowballProgram)System.Activator.CreateInstance(stemClass);
         // why doesn't the SnowballProgram class have an (abstract?) stem method?
         stemMethod = stemClass.GetMethod("Stem", (new System.Type[0] == null) ? new System.Type[0] : (System.Type[]) new System.Type[0]);
     }
     catch (System.Exception e)
     {
         throw new System.SystemException(e.ToString());
     }
 }
예제 #5
0
 //private System.Reflection.MethodInfo stemMethod;
 public SnowballFilter(TokenStream input, SnowballProgram stemmer)
     : base(input)
 {
     this.stemmer = stemmer;
     termAtt = AddAttribute<ITermAttribute>();
 }
예제 #6
0
		public SnowballFilter(TokenStream in_Renamed, SnowballProgram stemmer, System.Reflection.MethodInfo stemMethod) : base(in_Renamed)
		{
			this.stemmer = stemmer;
			this.stemMethod = stemMethod;
		}
예제 #7
0
        //private System.Reflection.MethodInfo stemMethod;

        public SnowballFilter(TokenStream input, SnowballProgram stemmer)
            : base(input)
        {
            this.stemmer = stemmer;
            termAtt      = AddAttribute <ITermAttribute>();
        }
예제 #8
0
 public SnowballFilter(TokenStream in_Renamed, SnowballProgram stemmer, System.Reflection.MethodInfo stemMethod) : base(in_Renamed)
 {
     this.stemmer    = stemmer;
     this.stemMethod = stemMethod;
 }