Class KantanMTConnector

  • All Implemented Interfaces:
    AutoCloseable, Iterator<QueryResult>, IQuery

    @Deprecated
    public class KantanMTConnector
    extends BaseConnector
    Deprecated.
    Note: This class has been deprecated because the API version it uses is phased out. Use KantanMTv21Connector instead. Connector for the KantanMT API. These calls depend on an authorization token and profile ID provided by the user. The profile ID specifies a particular MT engine within the KantanMT service. The engine must be started separately (through the KantanMT web interface, or via API) and is assumed to be running by this connector. As the engine initialization process takes several minutes, the connector does not perform initialization on its own in the open() method.
    See Also:
    http://docs.kantanmt.apiary.io
    • Constructor Detail

      • KantanMTConnector

        public KantanMTConnector()
        Deprecated.
    • Method Detail

      • getServerURL

        protected String getServerURL()
        Deprecated.
      • getConnectionTimeout

        protected int getConnectionTimeout()
        Deprecated.
      • getSocketTimeout

        protected int getSocketTimeout()
        Deprecated.
      • getName

        public String getName()
        Deprecated.
        Description copied from interface: IQuery
        Gets the name of the connector.
        Returns:
        the name of the connector.
      • getSettingsDisplay

        public String getSettingsDisplay()
        Deprecated.
        Description copied from interface: IQuery
        Gets a display representation of the current settings for this connector. This can be a display of some of the parameters for example, or some explanations about default non-modifiable settings.
        Returns:
        a display representation of the current settings.
      • open

        public void open()
        Deprecated.
        Description copied from interface: IQuery
        Opens this query engine.
      • close

        public void close()
        Deprecated.
        Description copied from interface: IQuery
        Closes this connector.
      • query

        public int query​(String plainText)
        Deprecated.
        Description copied from interface: IQuery
        Starts a query for a give plain text.
        Parameters:
        plainText - text to query.
        Returns:
        The number of hits for the given query.
      • query

        public int query​(TextFragment tf)
        Deprecated.
        Description copied from interface: IQuery
        Starts a query for a given text.
        Parameters:
        tf - The text to query.
        Returns:
        The number of hits for the given query.
      • hasNext

        public boolean hasNext()
        Deprecated.
        Description copied from interface: IQuery
        Indicates of there is a hit available.
        Specified by:
        hasNext in interface IQuery
        Specified by:
        hasNext in interface Iterator<QueryResult>
        Overrides:
        hasNext in class BaseConnector
        Returns:
        True if a hit is available, false if not.
      • next

        public QueryResult next()
        Deprecated.
        Description copied from interface: IQuery
        Gets the next hit for the last query.
        Specified by:
        next in interface IQuery
        Specified by:
        next in interface Iterator<QueryResult>
        Overrides:
        next in class BaseConnector
        Returns:
        A QueryResult object that holds the source and target text of the hit, or null if there is no more hit.
      • batchQuery

        public List<List<QueryResult>> batchQuery​(List<TextFragment> fragments)
        Deprecated.
        Description copied from class: BaseConnector
        Slow default implementation using query!! Override to take advantage of servers batch API
        Specified by:
        batchQuery in interface IQuery
        Overrides:
        batchQuery in class BaseConnector
        Parameters:
        fragments - list of the text fragments to translate.
        Returns:
        a list of lists of query result. Each list corresponds to a source text (in the same order)