Ejemplo n.º 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>();
 }
Ejemplo n.º 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>();
		}
Ejemplo n.º 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());
			}
		}
Ejemplo n.º 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());
     }
 }
Ejemplo n.º 5
0
 //private System.Reflection.MethodInfo stemMethod;
 public SnowballFilter(TokenStream input, SnowballProgram stemmer)
     : base(input)
 {
     this.stemmer = stemmer;
     termAtt = AddAttribute<ITermAttribute>();
 }
Ejemplo n.º 6
0
		public SnowballFilter(TokenStream in_Renamed, SnowballProgram stemmer, System.Reflection.MethodInfo stemMethod) : base(in_Renamed)
		{
			this.stemmer = stemmer;
			this.stemMethod = stemMethod;
		}
Ejemplo n.º 7
0
        //private System.Reflection.MethodInfo stemMethod;

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