public class Voikko extends Object
Constructor and Description |
---|
Voikko(String language)
Creates a new Voikko instance using only the default dictionary search path
|
Voikko(String language,
String path)
Creates a new Voikko instance
|
Modifier and Type | Method and Description |
---|---|
static void |
addLibraryPath(String libraryPath)
Set the explicit path to the folder containing shared library files.
|
List<Analysis> |
analyze(String word)
Analyze the morphology of given word and return the list of
analysis results.
|
protected void |
finalize() |
String |
getHyphenationPattern(String word)
Return a character pattern that describes the hyphenation of given word
|
List<GrammarError> |
grammarErrors(String text,
String language)
Check the given text for grammar errors and return a
list of GrammarError objects representing the errors that were found.
|
String |
hyphenate(String word) |
static List<Dictionary> |
listDicts() |
static List<Dictionary> |
listDicts(String path) |
List<Sentence> |
sentences(String text)
Split the given natural language text into a list of Sentence objects.
|
void |
setAcceptAllUppercase(boolean value)
Accept words even when all of the letters are in uppercase.
|
void |
setAcceptBulletedListsInGc(boolean value)
(Grammar checking only): Accept paragraphs if they would be valid within
bulleted lists.
|
void |
setAcceptExtraHyphens(boolean value)
(Spell checking only): Allow some extra hyphens in words.
|
void |
setAcceptFirstUppercase(boolean value)
Accept words even when the first letter is in uppercase (start of sentence etc.)
|
void |
setAcceptMissingHyphens(boolean value)
(Spell checking only): Accept missing hyphens at the start and end of the word.
|
void |
setAcceptTitlesInGc(boolean value)
(Grammar checking only): Accept incomplete sentences that could occur in
titles or headings.
|
void |
setAcceptUnfinishedParagraphsInGc(boolean value)
(Grammar checking only): Accept incomplete sentences at the end of the
paragraph.
|
void |
setHyphenateUnknownWords(boolean value)
(Hyphenation only): Hyphenate unknown words.
|
void |
setIgnoreDot(boolean value)
Ignore dot at the end of the word (needed for use in some word processors).
|
void |
setIgnoreNonwords(boolean value)
(Spell checking only): Ignore non-words such as URLs and email addresses.
|
void |
setIgnoreNumbers(boolean value)
Ignore words containing numbers.
|
void |
setIgnoreUppercase(boolean value)
Accept words that are written completely in uppercase letters without checking
them at all.
|
void |
setMinHyphenatedWordLength(int length)
The minimum length for words that may be hyphenated.
|
void |
setNoUglyHyphenation(boolean value)
Do not insert hyphenation positions that are considered to be ugly but correct
Default: false
|
void |
setSpellerCacheSize(int sizeParam)
Controls the size of in memory cache for spell checking results. 0 is the default size,
1 is twice as large as 0 etc. -1 disables the spell checking cache entirely.
|
void |
setSuggestionStrategy(SuggestionStrategy suggestionStrategy)
Set the suggestion strategy to be used when generating spelling suggestions.
|
boolean |
spell(String word)
Check the spelling of given word.
|
List<String> |
suggest(String word) |
void |
terminate()
Releases the resources allocated by libvoikko for this instance.
|
List<Token> |
tokens(String text)
Split the given natural language text into a list of Token objects.
|
public Voikko(String language)
language
- BCP 47 language tag to be usedpublic void terminate()
protected void finalize() throws Throwable
public boolean spell(String word)
word
- public static List<Dictionary> listDicts()
public static List<Dictionary> listDicts(String path)
path
- public List<String> suggest(String word)
word
- public List<GrammarError> grammarErrors(String text, String language)
text
- language
- language in which error descriptions should be returnedpublic List<Analysis> analyze(String word)
word
- public List<Token> tokens(String text)
text
- public List<Sentence> sentences(String text)
text
- public String getHyphenationPattern(String word)
word
- public String hyphenate(String word)
word
- public void setIgnoreDot(boolean value)
value
- public void setIgnoreNumbers(boolean value)
value
- public void setIgnoreUppercase(boolean value)
value
- public void setAcceptFirstUppercase(boolean value)
value
- public void setAcceptAllUppercase(boolean value)
value
- public void setIgnoreNonwords(boolean value)
value
- public void setAcceptExtraHyphens(boolean value)
value
- public void setAcceptMissingHyphens(boolean value)
value
- public void setAcceptTitlesInGc(boolean value)
value
- public void setAcceptUnfinishedParagraphsInGc(boolean value)
value
- public void setAcceptBulletedListsInGc(boolean value)
value
- public void setNoUglyHyphenation(boolean value)
value
- public void setHyphenateUnknownWords(boolean value)
value
- public void setMinHyphenatedWordLength(int length)
length
- public void setSpellerCacheSize(int sizeParam)
sizeParam
- public void setSuggestionStrategy(SuggestionStrategy suggestionStrategy)
SuggestionStrategy.TYPO
suggestionStrategy
- public static void addLibraryPath(String libraryPath)
libraryPath
- Copyright © 2016 Voikko developers. All rights reserved.