BigML.Model.LocalModel.termMatches C# (CSharp) Méthode

termMatches() private méthode

private termMatches ( string text, string fieldLabel, string term ) : int
text string
fieldLabel string
term string
Résultat int
            private int termMatches(string text, string fieldLabel, string term)
            {
                RegexOptions flags = RegexOptions.IgnoreCase;

                Dictionary<string, string> wordsMatch = _termForms[fieldLabel];
                MatchCollection matches;
                if (wordsMatch.ContainsKey(term))
                {
                    if (_caseSensitive.ContainsKey(fieldLabel))
                    {
                        matches = Regex.Matches(text, term);
                    }
                    else
                    {
                        matches = Regex.Matches(text, term, flags);
                    }
                    return matches.Count;
                }
                return 0;
            }