Ejemplo n.º 1
0
        public void analyzeConditional(TextKeeper keeper, Int32 languageId)
        {
            Char  symbolFirst, symbolSecond;
            Int32 indexFirst, indexSecond;
            Int64 currentTextLength = 0;

            foreach (String line in keeper.getText())
            {
                for (int i = 0; i < line.Length; i++)
                {
                    symbolFirst = line[i];
                    indexFirst  = Helper.getCharIndex(symbolFirst, languageId);

                    if (i != line.Length - 1)
                    {
                        symbolSecond = line[i + 1];
                        indexSecond  = Helper.getCharIndex(symbolSecond, languageId);
                        if (indexFirst != -1 && indexSecond != -1)
                        {
                            conditionalFrequencies[indexFirst, indexSecond] += 1;
                            currentTextLength++;
                        }
                    }
                }
            }
            this.textLength = currentTextLength;
        }
Ejemplo n.º 2
0
 public void analyze(TextKeeper keeper)
 {
     foreach (String line in keeper.getText())
     {
         foreach (Char sym in line.ToLower())
         {
             if (absoluteFrequencies.ContainsKey(sym.ToString()))
             {
                 absoluteFrequencies[sym.ToString()] += 1;
             }
         }
     }
 }