@@ -0,0 +1,1795 @@
+package com.bbn.nlp.corpora.OffsetMapping;%0A%0Aimport com.google.common.collect.Range;%0A%0Aimport java.util.Collection;%0A%0A/**%0A * Offset Mapper - handling of character encoding is left to implementations. See @%7Bcode%0A * AbstractOffsetMapper%7D for default implementations%0A *%0A * It is up to implementations to ensure that all ranges passed are of the form %5Bclosed, closed%5D%0A */%0Ainterface OffsetMapper %7B%0A%0A  /**%0A   * Maps an offset in the source to the corresponding offset or offsets (perhaps none) in the%0A   * target.  If offsetIdx is out-of-bounds in the source, throws an IndexOutOfBoundsException.%0A   **/%0A  Collection%3CInteger%3E mapOffset(final int offsetIdx);%0A%0A  /**%0A   * Maps a range of offsets in the source to the corresponding offset ranges in the target (if%0A   * any).   Note that a single source range may map to multiple target ranges (for example, if the%0A   * source is EDT offsets and we are mapping to character offsets).%0A   *%0A   * If the range is out-of-bounds in the source, throws an IndexOutOfBoundsException. If the source%0A   * range is not closed on both ends, throws an IllegalArgumentException. All returned Ranges will%0A   * be closed on both ends.%0A   *%0A   * @param closedSource - a range that is closed on the left, open on the right, typically%0A   *                         constructed as Range.closed(offset, offset + length-1)%0A   */%0A  Collection%3CRange%3CInteger%3E%3E mapRange(final Range%3CInteger%3E closedSource);%0A%0A  /**%0A   * makes a best effort to return a reverse mapping%0A   */%0A  OffsetMapper inverseMapper();%0A%0A  /**%0A   * is this source index mapped?%0A   * @param source%0A   * @return%0A   */%0A  boolean isMapped(final int source);%0A%0A  /**%0A   * is everything in %5Bclosed, closed%5D mapped?%0A   * @param closedSource%0A   * @return%0A   */%0A  boolean isEntirelyMapped(final Range%3CInteger%3E closedSource);%0A%7D%0A

add an interface to handle offset mapping