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