public PosBeamSearch(MaximumEntropyPosTagger posTagger, int size, IPosContextGenerator contextGenerator, SharpEntropy.IMaximumEntropyModel model, int cacheSize)
     : base(size, contextGenerator, model, cacheSize)
 {
     mMaxentPosTagger = posTagger;
 }
示例#2
0
 public PosBeamSearch(MaximumEntropyPosTagger posTagger, int size, IPosContextGenerator contextGenerator, SharpEntropy.IMaximumEntropyModel model, int cacheSize) :
     base(size, contextGenerator, model, cacheSize)
 {
     _maxentPosTagger = posTagger;
 }
示例#3
0
 public Ranker(string query)
 {
     if (tagger == null)
         tagger = new MaximumEntropyPosTagger(new GisModel(new SharpEntropy.IO.BinaryGisModelReader(ModelLocation)), new DefaultPosContextGenerator(), new PosLookupList(dictionaryLocation));
     Regex r = new Regex("[\\[\\]\\(\\)\\{\\}'\"\\?\\*\\+\\.\\|\\^,]", RegexOptions.IgnoreCase);
     // retaining the case for tagging
     this.queryTags = tagger.Tag(query.Split(' ')).ToList<string>();
     this.query = query.ToLower();
     queryWords = r.Replace(this.query, "").Split(' ').ToList<string>();
     this.relevantQueryTerms = this.queryWords.Where((s, i) => !Ranker.irrelevantTags.Contains(this.queryTags[i])).ToList<string>();
     // setting the
     Wnlib.WNCommon.path = WordNetPath;
 }