info.textgrid.utils.linkrewriter
Class TokenReplacement
java.lang.Object
info.textgrid.utils.linkrewriter.AbstractReplacement
info.textgrid.utils.linkrewriter.TokenReplacement
public class TokenReplacement
extends AbstractReplacement
A replacement that replaces on a token-by-token basis.
- Author:
- vitt
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TokenReplacement
public TokenReplacement(String from,
String to)
apply
public String apply(String in)
- applies this replacement to the given string.
The
TokenReplacement
implementation first tokenizes the given
string and then checks each token whether it matches either the from
string or the from string + '#' + a fragment. If so, the the replacement
is applied. Everything else is passed in unchanged.
- Specified by:
apply
in class AbstractReplacement
Copyright © 2012 TextGrid. All Rights Reserved.