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

Richard Eckart de Castilho updated UIMA-5830:
---------------------------------------------
    Description: 
I don't find a way to implement selection from the end by index using SelectFS 
- maybe it is a bug or maybe it is not supported:

{code}
    String text = "Rot wood cheeses dew?";
    tokenBuilder.buildTokens(jCas, text);

    // uimaFIT: JCasUtil.selectByIndex(jCas, Token.class, -1).getCoveredText()
    assertEquals("dew?", 
jCas.select(Token.class).backwards().get(0).getCoveredText());
{code}

The `uimaFIT` line is how it works in uimaFIT. Below my attempt in doing it 
using SelectFS. my understanding is that `backwards()` should change the 
iteration order (so starting at the end of the index instead of at the 
beginning in this case) and then `get(0)` should get the final token `dew?`. 
But instead, the statement returns the first token `Rot`.

  was:
I don't find a way to implement selection from the end by index using SelectFS 
- maybe it is a bug or maybe it is not supported:

{code}
    String text = "Rot wood cheeses dew?";
    tokenBuilder.buildTokens(jCas, text);

    // uimaFIT: JCasUtil.selectByIndex(jCas, Token.class, -1).getCoveredText()
    assertEquals("dew?", 
jCas.select(Token.class).backwards().get(1).getCoveredText());
{code}

The `uimaFIT` line is how it works in uimaFIT. Below my attempt in doing it 
using SelectFS. my understanding is that `backwards()` should change the 
iteration order (so starting at the end of the index instead of at the 
beginning in this case) and then `get(0)` should get the final token `dew?`. 
But instead, the statement returns the first token `Rot`.


> Unable to select from the end
> -----------------------------
>
>                 Key: UIMA-5830
>                 URL: https://issues.apache.org/jira/browse/UIMA-5830
>             Project: UIMA
>          Issue Type: Bug
>          Components: UIMA
>    Affects Versions: 3.0.0SDK
>            Reporter: Richard Eckart de Castilho
>            Priority: Major
>
> I don't find a way to implement selection from the end by index using 
> SelectFS - maybe it is a bug or maybe it is not supported:
> {code}
>     String text = "Rot wood cheeses dew?";
>     tokenBuilder.buildTokens(jCas, text);
>     // uimaFIT: JCasUtil.selectByIndex(jCas, Token.class, -1).getCoveredText()
>     assertEquals("dew?", 
> jCas.select(Token.class).backwards().get(0).getCoveredText());
> {code}
> The `uimaFIT` line is how it works in uimaFIT. Below my attempt in doing it 
> using SelectFS. my understanding is that `backwards()` should change the 
> iteration order (so starting at the end of the index instead of at the 
> beginning in this case) and then `get(0)` should get the final token `dew?`. 
> But instead, the statement returns the first token `Rot`.



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

Reply via email to