RC2 compatibility
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / text / spelling / engine / ISpellDictionary.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11
12 package net.sourceforge.phpdt.internal.ui.text.spelling.engine;
13
14 import java.util.Set;
15
16 /**
17  * Interface of dictionaries to use for spell-checking.
18  * 
19  * @since 3.0
20  */
21 public interface ISpellDictionary {
22         
23         /**
24          * Returns whether this dictionary accepts new words.
25          * 
26          * @return <code>true</code> if this dictionary accepts new words, <code>false</code> otherwise
27          */
28         public boolean acceptsWords();
29
30         /**
31          * Externalizes the specified word.
32          * 
33          * @param word
34          *                   The word to externalize in the dictionary
35          */
36         public void addWord(String word);
37
38         /**
39          * Returns the ranked word proposals for an incorrectly spelled word.
40          * 
41          * @param word
42          *                   The word to retrieve the proposals for
43          * @param sentence
44          *                   <code>true</code> iff the proposals start a new sentence,
45          *                   <code>false</code> otherwise
46          * @return Array of ranked word proposals
47          */
48         public Set getProposals(String word, boolean sentence);
49
50         /**
51          * Is the specified word correctly spelled?
52          * 
53          * @param word
54          *                   The word to spell-check
55          * @return <code>true</code> iff this word is correctly spelled, <code>false</code>
56          *               otherwise.
57          */
58         public boolean isCorrect(String word);
59
60         /**
61          * Is the dictionary loaded?
62          * 
63          * @return <code>true</code> iff it is loaded, <code>false</code>
64          *               otherwise
65          */
66         public boolean isLoaded();
67
68         /**
69          * Empties the dictionary.
70          */
71         public void unload();
72 }