/usr/lib/libreoffice/share/extensions/voikko/pythonpath/HyphenatedWord.py is in libreoffice-voikko 5.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | # Libreoffice-voikko: Linguistic extension for LibreOffice
# Copyright (C) 2015 Harri Pitkänen <hatapitk@iki.fi>
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 3 or later (the "GPL"), in which
# case the provisions of the GPL are applicable instead of those above.
import logging
import unohelper
from com.sun.star.linguistic2 import XHyphenatedWord
class HyphenatedWord(unohelper.Base, XHyphenatedWord):
def __init__(self, word, pos, locale):
self.__word = word
self.__hyphenPos = pos
self.__locale = locale
if word[pos + 1] == '-':
self.__hyphenatedWord = word[:pos+1] + word[pos+2:]
self.__isAlternative = True
else:
self.__hyphenatedWord = word
self.__isAlternative = False
logging.debug("HyphenatedWord.__init__: " + word)
logging.debug("HyphenatedWord.__init__: " + str(pos))
def getWord(self):
return self.__word
def getHyphenatedWord(self):
return self.__hyphenatedWord
def getLocale(self):
return self.__locale
def getHyphenationPos(self):
return self.__hyphenPos
def getHyphenPos(self):
return self.__hyphenPos
def isAlternativeSpelling(self):
return self.__isAlternative
|