KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > text > spelling > engine > ISpellDictionary


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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  *******************************************************************************/

11
12 package org.eclipse.jdt.internal.ui.text.spelling.engine;
13
14 import java.util.Set JavaDoc;
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 JavaDoc 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 JavaDoc getProposals(String JavaDoc word, boolean sentence);
49
50     /**
51      * Is the specified word correctly spelled?
52      *
53      * @param word the word to spell check
54      * @return <code>true</code> iff this word is correctly spelled, <code>false</code> otherwise
55      */

56     public boolean isCorrect(String JavaDoc word);
57
58     /**
59      * Is the dictionary loaded?
60      *
61      * @return <code>true</code> iff it is loaded, <code>false</code> otherwise
62      */

63     public boolean isLoaded();
64
65     /**
66      * Empties the dictionary.
67      */

68     public void unload();
69
70     /**
71      * Tells whether to strip non-letters from word boundaries.
72      *
73      * @param state <code>true</code> if non-letters should be stripped
74      * @since 3.3
75      */

76     public void setStripNonLetters(boolean state);
77 }
78
Popular Tags