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
9 * IBM Corporation - initial API and implementation
10 * Sergey Prigogin (Google)
11 *******************************************************************************/
13 package org.eclipse.cdt.internal.ui.text.spelling.engine;
18 * Interface of dictionaries to use for spell checking.
20 public interface ISpellDictionary {
22 * Returns whether this dictionary accepts new words.
24 * @return <code>true</code> if this dictionary accepts new words, <code>false</code> otherwise
26 public boolean acceptsWords();
29 * Externalizes the specified word.
31 * @param word The word to externalize in the dictionary
33 public void addWord(String word);
36 * Returns the ranked word proposals for an incorrectly spelled word.
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
43 public Set<RankedWordProposal> getProposals(String word, boolean sentence);
46 * Is the specified word correctly spelled?
48 * @param word the word to spell check
49 * @return <code>true</code> iff this word is correctly spelled, <code>false</code> otherwise
51 public boolean isCorrect(String word);
54 * Is the dictionary loaded?
56 * @return <code>true</code> iff it is loaded, <code>false</code> otherwise
58 public boolean isLoaded();
61 * Empties the dictionary.
66 * Tells whether to strip non-letters from word boundaries.
68 * @param state <code>true</code> if non-letters should be stripped
70 public void setStripNonLetters(boolean state);