You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "Joern Kottmann (Commented) (JIRA)" <ji...@apache.org> on 2012/04/04 22:11:22 UTC

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

    [ 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