All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.isi.nlp.strings.offsets.TokenOffset Maven / Gradle / Ivy

The newest version!
package edu.isi.nlp.strings.offsets;

/** Represents an offset into a token sequence (whether sentence- or document-based) */
public final class TokenOffset extends AbstractOffset {

  private TokenOffset(final int val) {
    super(val);
  }

  public static TokenOffset asTokenOffset(final int val) {
    return new TokenOffset(val);
  }

  @Override
  public String toString() {
    return "t" + Integer.toString(asInt());
  }

  @Override
  public TokenOffset shiftedCopy(final int shiftAmount) {
    return TokenOffset.asTokenOffset(asInt() + shiftAmount);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy