ClassifierForJ: DotNet.patch

File DotNet.patch, 1.4 kB (added by edrishn, 2 years ago)

click "Original Format" at bottom of page to download

  • NClassifier\summariser\SimpleSummariser.cs

    old new  
    121121                                result.Append(sentence); 
    122122                                result.Append("."); 
    123123                                // This isn't always correct - perhaps it should be whatever symbol the sentence finished with 
    124                                 if (it.MoveNext()) 
    125                                 { 
    126                                         result.Append(" "); 
    127                                 } 
     124                                result.Append(" "); 
    128125                        } 
    129126 
    130                         return result.ToString()
     127                        return result.ToString().TrimEnd(' ')
    131128                } 
    132129 
    133130/** 
  • NClassifier\vector\VectorClassifier.cs

    old new  
    9999                { 
    100100                        int[] result = new int[terms.Length]; 
    101101                        for (int i = 0; i < terms.Length; i++) { 
    102                                 int value = (int)wordFrequencies[terms[i]]; 
    103                                 if (value == System.Int32.MinValue
     102                                object value = wordFrequencies[terms[i]]; 
     103                                if (value == null
    104104                                { 
    105105                                        result[i] = 0; 
    106106                                } 
    107107                                else 
    108108                                { 
    109                                         result[i] = value; 
     109                                        result[i] = (int) value; 
    110110                                } 
    111111 
    112112                        }