void ShowTags(NLTagScheme tagScheme)
        {
            if (!String.IsNullOrWhiteSpace(UserInput.Text))
            {
                var tagger = new NLTagger(new NLTagScheme[] { tagScheme });
                var range  = new NSRange(0, UserInput.Text.Length);
                tagger.String = UserInput.Text;

                tags            = tagger.GetTags(range, NLTokenUnit.Word, tagScheme, NLTaggerOptions.OmitWhitespace, out NSValue[] ranges);
                tokenRanges     = ranges;
                detailViewTitle = tagScheme == NLTagScheme.NameType ? "Named Entities" : "Parts of Speech";

                PerformSegue(ShowEntitiesSegue, this);
            }
        }
示例#2
0
 public Dictionary <NLLanguage, double> GetTagHypotheses(nuint characterIndex, NLTokenUnit unit, NLTagScheme scheme, nuint maximumCount)
 {
     using (var hypo = GetNativeTagHypotheses(characterIndex, unit, scheme.GetConstant(), maximumCount))
         return(NLLanguageExtensions.Convert(hypo));
 }