Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Synonyms
- Dim language As New com.sun.star.lang.Locale
- language.Language = "hu"
- language.Country = "HU"
- thes = createUnoService("com.sun.star.linguistic2.Thesaurus")
- Doc = ThisComponent
- Pars = ThisComponent.Text.createEnumeration
- While Pars.hasMoreElements
- TextElement = Pars.nextElement
- If TextElement.supportsService("com.sun.star.text.Paragraph") Then
- Word = TextElement.String
- result = thes.queryMeanings(Word, language, Array())
- If not IsNull(result) Then
- stems = Word
- For Each i In result
- synonyms = i.querySynonyms
- For Each j In synonyms
- stems = stems + " " + j
- Next j
- Next i
- TextElement.String = stems
- End If
- End If
- WEnd
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment