public PosBeamSearch(MaximumEntropyPosTagger posTagger, int size, IPosContextGenerator contextGenerator, SharpEntropy.IMaximumEntropyModel model, int cacheSize) : base(size, contextGenerator, model, cacheSize) { mMaxentPosTagger = posTagger; }
public PosBeamSearch(MaximumEntropyPosTagger posTagger, int size, IPosContextGenerator contextGenerator, SharpEntropy.IMaximumEntropyModel model, int cacheSize) : base(size, contextGenerator, model, cacheSize) { _maxentPosTagger = posTagger; }
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; }