Search in sources :

Example 21 with PeekReader

use of org.apache.jena.atlas.io.PeekReader in project jena by apache.

the class TokenizerFactory method makeTokenizer.

/** Safe use of a StringReader */
public static Tokenizer makeTokenizer(StringReader reader) {
    PeekReader peekReader = PeekReader.make(reader);
    Tokenizer tokenizer = new TokenizerText(peekReader);
    return tokenizer;
}
Also used : PeekReader(org.apache.jena.atlas.io.PeekReader)

Example 22 with PeekReader

use of org.apache.jena.atlas.io.PeekReader in project jena by apache.

the class TokenizerFactory method makeTokenizerString.

public static Tokenizer makeTokenizerString(String str) {
    PeekReader peekReader = PeekReader.readString(str);
    Tokenizer tokenizer = new TokenizerText(peekReader);
    return tokenizer;
}
Also used : PeekReader(org.apache.jena.atlas.io.PeekReader)

Aggregations

PeekReader (org.apache.jena.atlas.io.PeekReader)22 BaseTest (org.apache.jena.atlas.junit.BaseTest)9 Test (org.junit.Test)9 ArrayList (java.util.ArrayList)1 RiotException (org.apache.jena.riot.RiotException)1