public class LinguisticServices extends LinguServices
Constructor and Description |
---|
LinguisticServices(com.sun.star.uno.XComponentContext xContext) |
Modifier and Type | Method and Description |
---|---|
static com.sun.star.lang.Locale |
getLocale(Language lang)
Get a Locale from a LT defined language
|
int |
getNumberOfSyllables(String word,
Language lang)
Returns the number of syllable of a word
Returns -1 if the word was not found or anything goes wrong
|
int |
getNumberOfSyllables(String word,
com.sun.star.lang.Locale locale) |
String[] |
getSpellAlternatives(String word,
Language lang)
Returns Alternatives to wrong spelled word
|
String[] |
getSpellAlternatives(String word,
com.sun.star.lang.Locale locale) |
protected com.sun.star.linguistic2.XSpellChecker |
getSpellChecker(com.sun.star.uno.XComponentContext xContext)
Get the SpellChecker to be used.
|
List<String> |
getSynonyms(String word,
Language lang)
Get all synonyms of a word as list of strings.
|
List<String> |
getSynonyms(String word,
com.sun.star.lang.Locale locale) |
boolean |
isCorrectSpell(String word,
Language lang)
Returns true if the spell check is positive
|
boolean |
isCorrectSpell(String word,
com.sun.star.lang.Locale locale) |
boolean |
isThesaurusRelevantRule(String ruleId)
Test if rule is thesaurus relevant
(match should give suggestions from thesaurus)
|
void |
printLinguProperties(com.sun.star.uno.XComponentContext xContext)
Print LiguProperties to log file (Used for tests only)
|
boolean |
setLtAsGrammarService(com.sun.star.uno.XComponentContext xContext)
Set LT as grammar checker for all supported languages
is normally used deactivate lightproof
|
boolean |
setLtAsGrammarService(com.sun.star.uno.XComponentContext xContext,
com.sun.star.lang.Locale locale)
Set LT as grammar checker for a specific language
is normally used deactivate lightproof
|
void |
setNoSynonymsAsSuggestions(boolean noSynonymsAsSuggestions)
Set Parameter to generate no synonyms (makes some rules faster, but results in no suggestions)
|
void |
setThesaurusRelevantRule(Rule rule)
Set a thesaurus relevant rule
|
public LinguisticServices(com.sun.star.uno.XComponentContext xContext)
public void setNoSynonymsAsSuggestions(boolean noSynonymsAsSuggestions)
public void printLinguProperties(com.sun.star.uno.XComponentContext xContext)
protected com.sun.star.linguistic2.XSpellChecker getSpellChecker(com.sun.star.uno.XComponentContext xContext)
public static com.sun.star.lang.Locale getLocale(Language lang)
public List<String> getSynonyms(String word, Language lang)
getSynonyms
in class LinguServices
public boolean isCorrectSpell(String word, Language lang)
isCorrectSpell
in class LinguServices
public boolean isCorrectSpell(String word, com.sun.star.lang.Locale locale)
public String[] getSpellAlternatives(String word, Language lang)
public String[] getSpellAlternatives(String word, com.sun.star.lang.Locale locale)
public int getNumberOfSyllables(String word, Language lang)
getNumberOfSyllables
in class LinguServices
public int getNumberOfSyllables(String word, com.sun.star.lang.Locale locale)
public boolean setLtAsGrammarService(com.sun.star.uno.XComponentContext xContext, com.sun.star.lang.Locale locale)
public boolean setLtAsGrammarService(com.sun.star.uno.XComponentContext xContext)
public void setThesaurusRelevantRule(Rule rule)
setThesaurusRelevantRule
in class LinguServices
public boolean isThesaurusRelevantRule(String ruleId)