/* * [Lookup.java] * * Summary: Interface to a web based Dictionary or a local dictionary. * * Copyright: (c) 2000-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 2.2 2008-04-06 add build to title, tidy code, fix spelling errors. */ package com.mindprod.esper; /** * Interface to a web based Dictionary or a local dictionary. *

* It can describe ordinary dictionaries or cross language * dictionaries. * * @author Roedy Green, Canadian Mind Products * @version 2.2 2008-04-06 add build to title, tidy code, fix spelling errors. * @since 2000 */ public interface Lookup { /** * Save any changes to this dictionary, and disconnect from it. */ public void close(); /** * Add a definition to the dictionary. May be a dummy if definePossible is false. * * @param word The word to be defined in the source language. If word already exists in dictionary, new * definition replaces. * @param definition The definition of the word in the target language. If null, removes existing definition. */ public void define( String word, String definition ); /** * Is it possible to define new words in this dictionary? * * @return true if you can add definitions, false otherwise. */ public boolean definePossible(); /** * lookup up a word in one language and get the equivalent in another. * * @param word word to look up, trimmed. * * @return translation of word */ public String lookup( String word ); /** * Open a connection to this dictionary. */ public void open(); } // end interface Lookup