Package morfologik.stemming
Class NoEncoder
- java.lang.Object
-
- morfologik.stemming.NoEncoder
-
- All Implemented Interfaces:
ISequenceEncoder
public class NoEncoder extends java.lang.Object implements ISequenceEncoder
No relative encoding at all (full target form is returned).
-
-
Constructor Summary
Constructors Constructor Description NoEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBufferdecode(java.nio.ByteBuffer reuse, java.nio.ByteBuffer source, java.nio.ByteBuffer encoded)Decodesencodedrelative tosource, optionally reusing the providedByteBuffer.java.nio.ByteBufferencode(java.nio.ByteBuffer reuse, java.nio.ByteBuffer source, java.nio.ByteBuffer target)Encodestargetrelative tosource, optionally reusing the providedByteBuffer.intprefixBytes()The number of encoded form's prefix bytes that should be ignored (needed for separator lookup).java.lang.StringtoString()
-
-
-
Method Detail
-
encode
public java.nio.ByteBuffer encode(java.nio.ByteBuffer reuse, java.nio.ByteBuffer source, java.nio.ByteBuffer target)Description copied from interface:ISequenceEncoderEncodestargetrelative tosource, optionally reusing the providedByteBuffer.- Specified by:
encodein interfaceISequenceEncoder- Parameters:
reuse- Reuses the providedByteBufferor allocates a new one if there is not enough remaining space.source- The source byte sequence.target- The target byte sequence to encode relative tosource- Returns:
- Returns the
ByteBufferwith encodedtarget.
-
decode
public java.nio.ByteBuffer decode(java.nio.ByteBuffer reuse, java.nio.ByteBuffer source, java.nio.ByteBuffer encoded)Description copied from interface:ISequenceEncoderDecodesencodedrelative tosource, optionally reusing the providedByteBuffer.- Specified by:
decodein interfaceISequenceEncoder- Parameters:
reuse- Reuses the providedByteBufferor allocates a new one if there is not enough remaining space.source- The source byte sequence.encoded- The previously encoded byte sequence.- Returns:
- Returns the
ByteBufferwith decodedtarget.
-
prefixBytes
public int prefixBytes()
Description copied from interface:ISequenceEncoderThe number of encoded form's prefix bytes that should be ignored (needed for separator lookup). An ugly workaround for GH-85, should be fixed by prior knowledge of whether the dictionary contains tags; then we can scan for separator right-to-left.- Specified by:
prefixBytesin interfaceISequenceEncoder- See Also:
- "https://github.com/morfologik/morfologik-stemming/issues/85"
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-