FAQ
Hi,

I don't understand why my third test fails. If I scape my "- delimiter"
what I expect is a character behaviour.

Could you clarify me what I'm doing wrong?


public void testStandardAnalyzer() throws Exception {
Analyzer a = new StandardAnalyzer();
assertAnalyzesTo(a, "ses1-one3", new String[]{"ses1-one3"});
assertAnalyzesTo(a, "session-one", new String[]{"session","one"});
assertAnalyzesTo(a, "session\\-one", new String[]{"session\\-one"});
}

Thanking in advance
Xavier Orri


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

Search Discussions

  • Erik Hatcher at Oct 13, 2005 at 12:43 pm
    StandardAnalyzer does not have any escaped-character handling
    capability. So the backslash and dash are treated without any
    special care in "session\-one".

    You will need to build your own Analyzer with a custom tokenizer to
    handle this type of escaping.

    Erik
    On Oct 13, 2005, at 8:29 AM, Xavier Orri wrote:

    Hi,

    I don't understand why my third test fails. If I scape my "-
    delimiter"
    what I expect is a character behaviour.

    Could you clarify me what I'm doing wrong?


    public void testStandardAnalyzer() throws Exception {
    Analyzer a = new StandardAnalyzer();
    assertAnalyzesTo(a, "ses1-one3", new String[]{"ses1-one3"});
    assertAnalyzesTo(a, "session-one", new String[]{"session","one"});
    assertAnalyzesTo(a, "session\\-one", new String[]{"session\\-
    one"});
    }

    Thanking in advance
    Xavier Orri


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedOct 13, '05 at 12:29p
activeOct 13, '05 at 12:43p
posts2
users2
websitelucene.apache.org

2 users in discussion

Xavier Orri: 1 post Erik Hatcher: 1 post

People

Translate

site design / logo © 2022 Grokbase