You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Marshall Schor (JIRA)" <de...@uima.apache.org> on 2018/07/16 19:03:00 UTC

[jira] [Commented] (UIMA-5826) asList() ignores limit

    [ https://issues.apache.org/jira/browse/UIMA-5826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16545621#comment-16545621 ] 

Marshall Schor commented on UIMA-5826:
--------------------------------------

found several issues in the code, fixing and adding a test case. (Test case contributions for "select" framework welcome!)

> asList() ignores limit
> ----------------------
>
>                 Key: UIMA-5826
>                 URL: https://issues.apache.org/jira/browse/UIMA-5826
>             Project: UIMA
>          Issue Type: Bug
>          Components: Core Java Framework
>    Affects Versions: 3.0.0SDK
>            Reporter: Richard Eckart de Castilho
>            Assignee: Marshall Schor
>            Priority: Major
>             Fix For: 3.0.1SDK
>
>
> In the following code, the `precedingsTokens` list should contain two elements. In fact, it does, but the `size()` method of the list still returns 6. That is because `org.apache.uima.cas.impl.SelectFSs_impl.asList()` simply uses the size of the underlying index and does not take into account limit or direction options from the select.
>  
> {code}
>     jCas.setDocumentText("abcde");
>     *new* Token(jCas, 0, 1).addToIndexes();
>     *new* Token(jCas, 1, 2).addToIndexes();
>     *new* Token(jCas, 2, 3).addToIndexes();
>     *new* Token(jCas, 3, 4).addToIndexes();
>     *new* Token(jCas, 4, 5).addToIndexes();
>     *new* Token(jCas, 1, 3).addToIndexes();
>     Token c = JCasUtil.selectAt(jCas, Token.*class*, 2, 3).get(0);
>     List<Token> preceedingTokens = jCas.select(Token.*class*).preceding(c).limit(2).asList();
>     
>     assertEquals(2, preceedingTokens.size());
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Test case contributions for "select" framework

Posted by Richard Eckart de Castilho <re...@apache.org>.
On 16. Jul 2018, at 21:03, Marshall Schor (JIRA) <de...@uima.apache.org> wrote:
> 
> (Test case contributions for "select" framework welcome!)

I have create a PR in the uimaFIT repo with a port of the uimaFIT JCasUtil tests using the SelectFS framework. This PR is still WIP. My main motivation is to figure out how compatible SelectFS is with uimaFIT and if all uimaFIT use-cases are supported by SelectFS.

https://github.com/apache/uima-uimafit/pull/19

Maybe you find it useful. Jenkins builds it, so you can see there what's working and
what's failing.

I'd consider contributing some tests to UIMA core itself, but there is unfortunately 
currently no GitHub mirror of it.


Cheers,

-- Richard