tablesmit / ude

Automatically exported from code.google.com/p/ude
Other
0 stars 0 forks source link

EUCTW: System.IndexOutOfRangeException #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The problem is CharDistributionAnalyser.HandleOneChar call for EUCTW detection.

size of charToFreqOrder array is 5376 but tableSize is deffind as 8102 and
this check is wrong
if (order < tableSize) <--
 { // order is valid
   if (512 > charToFreqOrder[order])
     freqChars++;
 }

I have take a look in Java code and this part of code is changed to

if (order < charToFreqOrder.Length)
{ // order is valid
  if (512 > charToFreqOrder[order])
    freqChars++;
}

we don't need tableSize any more and there will be no Exception at this
place in future.

Original issue reported on code.google.com by vla...@gmail.com on 16 Nov 2009 at 3:12

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Fixed in trunk. As you suggested, in C# the hard-coded array lengths (needed 
into the 
C++ mozilla code) are useless, having the length property in place.

Thanks for your help.

Original comment by rudi.pet...@gmail.com on 14 May 2010 at 12:48