public void Crap()
 {
     SynonymEngine engine = new SynonymEngine();
     char[] term = "Crap".ToCharArray();
     var result = engine.GetSynonyms(term, term.Length);
     Assert.IsNull(result);
 }
 public void UnitType_Apt()
 {
     SynonymEngine engine = new SynonymEngine();
     char[] term = "Apt".ToCharArray();
     var result = engine.GetSynonyms(term, term.Length);
     Assert.IsNotNull(result);
     Assert.AreEqual(2, result.Count());
 }
예제 #3
0
        public SynonymFilter (TokenStream input, SynonymEngine engine) : base(input) {
            if (engine == null)
                throw new ArgumentNullException("synonymEngine");
            synonymStack = new Stack<string>();
            this.engine = engine;

            this.termAtt = (TermAttribute)AddAttribute<ITermAttribute>();
            this.posIncrAtt = (PositionIncrementAttribute)AddAttribute<IPositionIncrementAttribute>();

            //this.termAtt = this.AddAttribute<string>();
            //this.posIncrAtt = this.AddAttribute<string>();
        }
예제 #4
0
        public SynonymFilter(TokenStream input, SynonymEngine engine) : base(input)
        {
            if (engine == null)
            {
                throw new ArgumentNullException("synonymEngine");
            }
            synonymStack = new Stack <string>();
            this.engine  = engine;

            this.termAtt    = (TermAttribute)AddAttribute <ITermAttribute>();
            this.posIncrAtt = (PositionIncrementAttribute)AddAttribute <IPositionIncrementAttribute>();

            //this.termAtt = this.AddAttribute<string>();
            //this.posIncrAtt = this.AddAttribute<string>();
        }
예제 #5
0
 public SynonymAnalyzer(SynonymEngine engine) { this.engine = engine; }
예제 #6
0
 public SynonymAnalyzer(SynonymEngine engine)
 {
     this.engine = engine;
 }
 public void Null()
 {
     SynonymEngine engine = new SynonymEngine();
     var result = engine.GetSynonyms(null, 0);
     Assert.IsNull(result);
 }