lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeroen Vuurens (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LUCENE-2849) StringIndexOutOfBoundsException on searchtime
Date Thu, 06 Jan 2011 13:16:47 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-2849?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jeroen Vuurens updated LUCENE-2849:
-----------------------------------

    Description: 
I've been trying to run the example PrecisionRecall.java code from Lucene in Action II (downloaded
the code, so its just as in the book). It gives a StringIndexOutOfBoundsException on my machine.


Figured it out. I copied QualityBenchmark and QualityStats from the Lucene source and inserted
a debugline to get a view of the argument values in the function that throws the exception.

private String fracFormat(String frac) {
int k = frac.indexOf('.');
String s1 = padd+frac.substring(0,k);
int n = Math.max(k,6);
s1 = s1.substring(s1.length()-n);
return s1 + frac.substring(k);
}

This function assumes that a decimal '.' is being used. However, the PC's we use over here
at uni have a different locale using a ',' for decimals. Think you might be able to catch
that by using (new DecimalFormatSymbols().getDecimalSeparator()) instead of ('.')? 


  was:
I've been trying to run the example PrecisionRecall.java code from Lucene in Action II (downloaded
the code, so its just as in the book). It gives a StringIndexOutOfBoundsException on my machine.


Figured it out. I copied QualityBenchmark and QualityStats from the Lucene source and inserted
a debugline to get a view of the argument values in the function that throws the exception.

private String fracFormat(String frac) {
int k = frac.indexOf('.');
String s1 = padd+frac.substring(0,k);
int n = Math.max(k,6);
s1 = s1.substring(s1.length()-n);
return s1 + frac.substring(k);
}

This function assumes that a decimal . is being used. However, the PC's we use over here at
uni have a different locale using a , for decimals. Think you might be able to catch that
by using DecimalFormatSymbols().getDecimalSeperator() instead of '.'? 



> StringIndexOutOfBoundsException on searchtime
> ---------------------------------------------
>
>                 Key: LUCENE-2849
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2849
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/benchmark
>    Affects Versions: 3.0.2
>         Environment: Windows XP
>            Reporter: Jeroen Vuurens
>            Priority: Minor
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I've been trying to run the example PrecisionRecall.java code from Lucene in Action II
(downloaded the code, so its just as in the book). It gives a StringIndexOutOfBoundsException
on my machine. 
> Figured it out. I copied QualityBenchmark and QualityStats from the Lucene source and
inserted a debugline to get a view of the argument values in the function that throws the
exception.
> private String fracFormat(String frac) {
> int k = frac.indexOf('.');
> String s1 = padd+frac.substring(0,k);
> int n = Math.max(k,6);
> s1 = s1.substring(s1.length()-n);
> return s1 + frac.substring(k);
> }
> This function assumes that a decimal '.' is being used. However, the PC's we use over
here at uni have a different locale using a ',' for decimals. Think you might be able to catch
that by using (new DecimalFormatSymbols().getDecimalSeparator()) instead of ('.')? 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message