Package org.apache.lucene.analysis.icu.tokenattributes

Examples of org.apache.lucene.analysis.icu.tokenattributes.ScriptAttribute


  }
 
  public void testTokenAttributes() throws Exception {
    TokenStream ts = a.tokenStream("dummy", "This is a test");
    try {
      ScriptAttribute scriptAtt = ts.addAttribute(ScriptAttribute.class);
      ts.reset();
      while (ts.incrementToken()) {
        assertEquals(UScript.LATIN, scriptAtt.getCode());
        assertEquals(UScript.getName(UScript.LATIN), scriptAtt.getName());
        assertEquals(UScript.getShortName(UScript.LATIN), scriptAtt.getShortName());
        assertTrue(ts.reflectAsString(false).contains("script=Latin"));
      }
      ts.end();
    } finally {
      IOUtils.closeWhileHandlingException(ts);
View Full Code Here


  }
 
  public void testTokenAttributes() throws Exception {
    TokenStream ts = a.tokenStream("dummy", "This is a test");
    try {
      ScriptAttribute scriptAtt = ts.addAttribute(ScriptAttribute.class);
      ts.reset();
      while (ts.incrementToken()) {
        assertEquals(UScript.LATIN, scriptAtt.getCode());
        assertEquals(UScript.getName(UScript.LATIN), scriptAtt.getName());
        assertEquals(UScript.getShortName(UScript.LATIN), scriptAtt.getShortName());
        assertTrue(ts.reflectAsString(false).contains("script=Latin"));
      }
      ts.end();
    } finally {
      IOUtils.closeWhileHandlingException(ts);
View Full Code Here

    checkRandomData(random, a, 100*RANDOM_MULTIPLIER, 8192);
  }
 
  public void testTokenAttributes() throws Exception {
    TokenStream ts = a.tokenStream("dummy", "This is a test");
    ScriptAttribute scriptAtt = ts.addAttribute(ScriptAttribute.class);
    ts.reset();
    while (ts.incrementToken()) {
      assertEquals(UScript.LATIN, scriptAtt.getCode());
      assertEquals(UScript.getName(UScript.LATIN), scriptAtt.getName());
      assertEquals(UScript.getShortName(UScript.LATIN), scriptAtt.getShortName());
      assertTrue(ts.reflectAsString(false).contains("script=Latin"));
    }
    ts.end();
    ts.close();
  }
View Full Code Here

    checkRandomData(random, a, 100*RANDOM_MULTIPLIER, 8192);
  }
 
  public void testTokenAttributes() throws Exception {
    TokenStream ts = a.tokenStream("dummy", new StringReader("This is a test"));
    ScriptAttribute scriptAtt = ts.addAttribute(ScriptAttribute.class);
    ts.reset();
    while (ts.incrementToken()) {
      assertEquals(UScript.LATIN, scriptAtt.getCode());
      assertEquals(UScript.getName(UScript.LATIN), scriptAtt.getName());
      assertEquals(UScript.getShortName(UScript.LATIN), scriptAtt.getShortName());
      assertTrue(ts.reflectAsString(false).contains("script=Latin"));
    }
    ts.end();
    ts.close();
  }
View Full Code Here

  }
 
  public void testTokenAttributes() throws Exception {
    TokenStream ts = a.tokenStream("dummy", "This is a test");
    try {
      ScriptAttribute scriptAtt = ts.addAttribute(ScriptAttribute.class);
      ts.reset();
      while (ts.incrementToken()) {
        assertEquals(UScript.LATIN, scriptAtt.getCode());
        assertEquals(UScript.getName(UScript.LATIN), scriptAtt.getName());
        assertEquals(UScript.getShortName(UScript.LATIN), scriptAtt.getShortName());
        assertTrue(ts.reflectAsString(false).contains("script=Latin"));
      }
      ts.end();
    } finally {
      IOUtils.closeWhileHandlingException(ts);
View Full Code Here

TOP

Related Classes of org.apache.lucene.analysis.icu.tokenattributes.ScriptAttribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.