You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "Jörn Kottmann (JIRA)" <ji...@apache.org> on 2011/07/18 12:47:00 UTC

[jira] [Created] (OPENNLP-229) Write a test case for the NameFinderSequenceValidator class

Write a test case for the NameFinderSequenceValidator class
-----------------------------------------------------------

                 Key: OPENNLP-229
                 URL: https://issues.apache.org/jira/browse/OPENNLP-229
             Project: OpenNLP
          Issue Type: Task
          Components: Name Finder
            Reporter: Jörn Kottmann
            Priority: Minor


The NameFinderSequenceValidator is public now, and that makes it possible to write a test for it. The test should check that the sequence validation works as expected.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (OPENNLP-229) Write a test case for the NameFinderSequenceValidator class

Posted by "Hyosup Shim (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENNLP-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hyosup Shim updated OPENNLP-229:
--------------------------------

    Attachment: patch_OPENNLP-229.java

I wrote some test case. Please review this.
                
> Write a test case for the NameFinderSequenceValidator class
> -----------------------------------------------------------
>
>                 Key: OPENNLP-229
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-229
>             Project: OpenNLP
>          Issue Type: Task
>          Components: Name Finder
>            Reporter: Joern Kottmann
>            Priority: Minor
>         Attachments: patch_OPENNLP-229.java
>
>
> The NameFinderSequenceValidator is public now, and that makes it possible to write a test for it. The test should check that the sequence validation works as expected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OPENNLP-229) Write a test case for the NameFinderSequenceValidator class

Posted by "Joern Kottmann (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENNLP-229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13246681#comment-13246681 ] 

Joern Kottmann commented on OPENNLP-229:
----------------------------------------

Sorry for the late review.

The whole idea of the sequence validator is that it checks if a sequence of outcomes is valid or not. The beam search algorithm uses it to figure out if a potential sequence is valid, if not this search path is discarded.

A test should come up with a couple of sequences and test that in the case of the name finder our implementation works correctly.

The question is which sequences should we test?
We should test allowed sequences, e.g. "start, cont, other start, other" and the sequence patterns which are not allowed e.g. a-start, b-cont, b-cont, other.

If I am not mistaken your test only checks the first index and ignores all other indexes. We should also pass in a valid sentence which has the same length
as the sequence. You could even use this to automate the testing a bit. Lets say the tokens are either valid or invalid in the sentence. You could construct a second sequence which tells some test code how we expect the validator to respond.

So we always have a sentence and a sequence pair.
sentence 1:
valid, valid, valid, fail
sequence 1:
other, start, other, cont

or
sentence 2:
valid, valid, valid, valid, valid
sequence 2:
a-start, a-cont, other, other, b-start
                
> Write a test case for the NameFinderSequenceValidator class
> -----------------------------------------------------------
>
>                 Key: OPENNLP-229
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-229
>             Project: OpenNLP
>          Issue Type: Task
>          Components: Name Finder
>            Reporter: Joern Kottmann
>            Priority: Minor
>         Attachments: patch_OPENNLP-229.java, patch_OPENNLP-229_added.patch
>
>
> The NameFinderSequenceValidator is public now, and that makes it possible to write a test for it. The test should check that the sequence validation works as expected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (OPENNLP-229) Write a test case for the NameFinderSequenceValidator class

Posted by "Hyosup Shim (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENNLP-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hyosup Shim updated OPENNLP-229:
--------------------------------

    Attachment: patch_OPENNLP-229_added.patch

I miscalculated coverage it yielded. so I added some more tests.
                
> Write a test case for the NameFinderSequenceValidator class
> -----------------------------------------------------------
>
>                 Key: OPENNLP-229
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-229
>             Project: OpenNLP
>          Issue Type: Task
>          Components: Name Finder
>            Reporter: Joern Kottmann
>            Priority: Minor
>         Attachments: patch_OPENNLP-229.java, patch_OPENNLP-229_added.patch
>
>
> The NameFinderSequenceValidator is public now, and that makes it possible to write a test for it. The test should check that the sequence validation works as expected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OPENNLP-229) Write a test case for the NameFinderSequenceValidator class

Posted by "Joern Kottmann (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENNLP-229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13234879#comment-13234879 ] 

Joern Kottmann commented on OPENNLP-229:
----------------------------------------

I reviewed the patch. We should test more cases for sequences which are allowed and not allowed. Please add more cases to the patch.
                
> Write a test case for the NameFinderSequenceValidator class
> -----------------------------------------------------------
>
>                 Key: OPENNLP-229
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-229
>             Project: OpenNLP
>          Issue Type: Task
>          Components: Name Finder
>            Reporter: Joern Kottmann
>            Priority: Minor
>         Attachments: patch_OPENNLP-229.java
>
>
> The NameFinderSequenceValidator is public now, and that makes it possible to write a test for it. The test should check that the sequence validation works as expected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira