Class Encoder.FailingEncoder

  • All Implemented Interfaces:
    Encoder
    Enclosing interface:
    Encoder

    public static class Encoder.FailingEncoder
    extends java.lang.Object
    implements Encoder
    • Constructor Summary

      Constructors 
      Constructor Description
      FailingEncoder()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.Integer> encode​(java.lang.String text, Language language)
      Encodes text into tokens in a list of ids.
      com.yahoo.tensor.Tensor encode​(java.lang.String text, Language language, com.yahoo.tensor.TensorType tensorType)
      Encodes text into tokens in a tensor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FailingEncoder

        public FailingEncoder()
    • Method Detail

      • encode

        public java.util.List<java.lang.Integer> encode​(java.lang.String text,
                                                        Language language)
        Description copied from interface: Encoder
        Encodes text into tokens in a list of ids.
        Specified by:
        encode in interface Encoder
        Parameters:
        text - the text to encode
        language - the language of the text, or UNKNOWN to use language independent encoding
        Returns:
        the text encoded to a list of segment ids
      • encode

        public com.yahoo.tensor.Tensor encode​(java.lang.String text,
                                              Language language,
                                              com.yahoo.tensor.TensorType tensorType)
        Description copied from interface: Encoder
        Encodes text into tokens in a tensor. The information contained in the encoding may depend on the tensor type.
        Specified by:
        encode in interface Encoder
        Parameters:
        text - the text to encode
        language - the language of the text, or UNKNOWN to use language independent encoding
        tensorType - the type of the ttensor to be returned
        Returns:
        the tex encoded into a tensor of the supplied type