Ada.Matchers.BoWPoS.PosTagger.GetModel C# (CSharp) Method

GetModel() public method

public GetModel ( string text ) : uint>.Dictionary
text string
return uint>.Dictionary
        public Dictionary<string, uint> GetModel(string text)
        {
            var prepared = PrepareBody(text);
            //var tagged = tagger.tagString(prepared);
            //var tagsStr = taggedChunks.Replace(tagged, "•$1•");
            var tags = modelTags.Replace(prepared, "$1").Split(' ');
            var tf = new Dictionary<string, uint>();

            foreach (var tag in tags)
            {
                var t = tag;

                if (!tag.StartsWith("•") || !tag.EndsWith("•"))
                {
                    t = endPunc.Replace(tag, "");
                }

                if (string.IsNullOrWhiteSpace(t) || (t.Length == 1 && char.IsPunctuation(t[0]))) continue;

                if (tf.ContainsKey(t))
                {
                    tf[t]++;
                }
                else
                {
                    tf[t] = 1;
                }
            }

            return tf;
        }