Class MMTConnector

    • Constructor Detail

      • MMTConnector

        public MMTConnector()
    • Method Detail

      • getName

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

        public String getSettingsDisplay()
        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.
      • close

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

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

        public int query​(String plainText)
        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 fragment)
        Queries the ModernMT API fro the configured server. See MMT Translate API for details.
        Parameters:
        fragment - the fragment to query.
        Returns:
        the number of translations (1 or 0).
      • getParameters

        public Parameters getParameters()
        Description copied from interface: IQuery
        Gets the current parameters of this connector.
        Specified by:
        getParameters in interface IQuery
        Overrides:
        getParameters in class BaseConnector
        Returns:
        the current parameters of this connector or null if no parameters are used.
      • setParameters

        public void setParameters​(IParameters params)
        Description copied from interface: IQuery
        Sets the parameters for opening and querying this connector.
        Specified by:
        setParameters in interface IQuery
        Overrides:
        setParameters in class BaseConnector
        Parameters:
        params - the parameters to set.