Verification Step - Patterns works with CheckMate but not with Java APIs (Exception thrown)

Issue #182 resolved
Former user created an issue

Original issue 182 created by zygolech... on 2011-08-23T14:28:09.000Z:

Hello,

During the execution of the verification process via Java API, I have the following error:
java.lang.IllegalStateException: No match available
at java.util.regex.Matcher.start(Matcher.java:325)
at net.sf.okapi.lib.verification.QualityChecker.checkPatterns(QualityChecker.java:721)
at net.sf.okapi.lib.verification.QualityChecker.processTextUnit(QualityChecker.java:260)
at net.sf.okapi.lib.verification.QualityCheckSession.processTextUnit(QualityCheckSession.java:406)
at net.sf.okapi.lib.verification.QualityCheckSession.executeRecheck(QualityCheckSession.java:214)
at net.sf.okapi.lib.verification.QualityCheckSession.recheckDocument(QualityCheckSession.java:174)
at Main.qualityCkeck(Main.java:157)
at Main.main(Main.java:52)

But, with the same configuration, if I execute the verification step in CheckMate, I have no errors and the patterns I have defined work as expected.

It seems that the problem come from the fact that I have introduced a pattern rule like the following (in fact source pattern is the same as the target pattern - ie. the same in a regexp way, not like "<same>")

See attached the configuration of the verification process and the Java sample program i use. For information I use Okapi libs v13.

Regards,
Emmanuel

Comments (10)

  1. Former user Account Deleted

    Comment [2.](https://code.google.com/p/okapi/issues/detail?id=182#c2) originally posted by zygolech... on 2011-08-24T06:57:40.000Z:

    Hello,

    Here is the TMX sample file (a bit big but it is the one with which I have made my tests).

    And, just an additional information (but perhaps you have already found it in the configuration file "qualityCheckConfiguration.qccfg"), the pattern for which the problem appear is the pattern 7 (see the extract below): usePattern7.b=true fromSourcePattern7.b=true severityPattern7.i=2 sourcePattern7=(
    (|
    [)([^
    (
    )
    [
    ]])+(
    )|
    ])$ targetPattern7=(
    (|
    [)([^
    (
    )
    [
    ]])+(
    )|
    ])$ descPattern7=References Auteur

    Regards, Emmanuel

  2. Former user Account Deleted

    Comment [5.](https://code.google.com/p/okapi/issues/detail?id=182#c5) originally posted by @ysavourel on 2011-09-06T11:23:45.000Z:

    I've tried the example code and I can't seem to be able to reproduce the exception.

    I get 664 errors, just like when using CheckMate. All the errors, including the one generated with the References Auteur pattern, seems to be legitimate errors.

    There is one repeated error with "» [décision attaquée, considérant 50]" that has "This is something only [Interbrew] can do’." for the source that looked suspect to me first, as the target has something between brackets, but then I noticed the $ in the pattern and realized the error was legit since [Interbrew] is not ending the string. If I move [Interbrew] at the end of the string, it correctly match the target pattern and the error goes away.

    cheers, -ys

  3. Former user Account Deleted

    Comment [6.](https://code.google.com/p/okapi/issues/detail?id=182#c6) originally posted by zygolech... on 2011-09-06T11:49:03.000Z:

    So, you confirm that the patterns that I use are correctly handled by the API (see my comment comment 2\.) and you have not an IllegalStateException raised. Can you tell me which version of the API you use? On which operating System and which JVM? (Perhaps there is a problem with the configuration file).

    Regards, Emmanuel

  4. Former user Account Deleted

    Comment [7.](https://code.google.com/p/okapi/issues/detail?id=182#c7) originally posted by @ysavourel on 2011-09-06T12:29:06.000Z:

    So, you confirm that the patterns that I use are correctly handled by the API (see my comment comment 2\.) and you have not an IllegalStateException raised.

    That is correct. I had to modify slightly you example code to make it run, but not in a way that changes the verification (just the display and the paths). I also used the tmx and qcs files provided.

    Can you tell me which version of the API you use? On which operating System and which JVM?

    I used the latest code in SVN. It matches the M14-snapshot. But as far i can recall we have no changes related to the verification lib since M13. (but I may have missed something). I was running under Windows-7 32bit, Java SE Runtime Environment build 1.6.0\_26-b03. And running under Eclipse.

  5. Log in to comment