Exemplo n.º 1
0
        public ArrayList <KeyDat <double, LanguageProfile> > DetectLanguageAll(string str)
        {
            Utils.ThrowException(mLanguageProfiles.Count == 0 ? new InvalidOperationException() : null);
            Utils.ThrowException(str == null ? new ArgumentNullException("str") : null);
            NGramProfile p = new NGramProfile(mN);

            p.AddTokensFromString(str);
            if (p.IsEmpty)
            {
                return(null);
            }
            p.DoRanking();
            return(DetectLanguageAll(p));
        }
Exemplo n.º 2
0
        public LanguageProfile FindMatchingLanguage(string str)
        {
            Utils.ThrowException(languageProfiles.Count == 0 ? new InvalidOperationException() : null);
            Utils.ThrowException(str == null ? new ArgumentNullException("str") : null);
            NGramProfile p = new NGramProfile(n);

            p.AddTokensFromString(str);
            if (p.IsEmpty)
            {
                return(null);
            }
            p.DoRanking();
            return(FindMatchingLanguage(p));
        }
Exemplo n.º 3
0
 public ArrayList<KeyDat<double, LanguageProfile>> DetectLanguageAll(string str)
 {
     Utils.ThrowException(mLanguageProfiles.Count == 0 ? new InvalidOperationException() : null);
     Utils.ThrowException(str == null ? new ArgumentNullException("str") : null);
     NGramProfile p = new NGramProfile(mN);
     p.AddTokensFromString(str);
     if (p.IsEmpty) { return null; }
     p.DoRanking();
     return DetectLanguageAll(p);
 }