GithubHelp home page GithubHelp logo

divvun / libreoffice-divvun Goto Github PK

View Code? Open in Web Editor NEW

This project forked from voikko/libreoffice-voikko

2.0 6.0 0.0 998 KB

Language checker and hyphenator extension for LibreOffice

License: Mozilla Public License 2.0

Makefile 6.87% Python 88.11% Emacs Lisp 0.29% Shell 4.74%
libreoffice grammar-checker saami

libreoffice-divvun's Introduction

What is this?
=============
This is libreoffice-divvun, a multi language spellchecker, grammar checker and
hyphenator extension for LibreOffice. It uses libdivvun for all linguistic operations.


License
=======
This package is distributed under the terms of Mozilla Public License Version 2.0
(see COPYING). Alternatively, the source code may be used under the terms of the
GNU General Public License, version 3 or later.


Authors
=======

Source code:
  2005 - 2016 Harri Pitkänen ([email protected])
Icon:
  2011 Tarja Lindfors ([email protected])

Porting status
==============
- Linux: This is the primary development platform, and should always work
- Other platforms: The extension is platform independent Python code and should
  work as long as libdivvun is available for the platform.

Platform identifiers to be used as directory names for native libraries on some of
the common platforms are:

  Windows (64 bit): Windows-64bit-WindowsPE
  Windows (32 bit): Windows-32bit-WindowsPE

Requirements
============

- LibreOffice 4.1 or later (must come with Python 3 or later)
- libdivvun
- Make, sed, find and zip for packaging.

Instructions for packaging
==========================

- Install all of the required software listed above.
- Run "make oxt". This will build the extensions package divvun.oxt under
  subdirectory build.
  * There are some settings available that can be used to customize the build.
    Please see "build settings" in Makefile. You may change any of these settings
    by running "make VARIABLE=value" instead of "make".


Supported Make targets
======================

- extension-files
    Builds the extension files under build/oxt.
- oxt
    Builds the extensions package divvun.oxt under subdirectory build.
- all
    Same as 'oxt'.
- install-unpacked DESTDIR=some_directory
    Installs the unpacked extension under directory DESTDIR. Default
    for DESTDIR is /usr/lib/libreoffice-divvun.
- dist-gzip
    Builds the source package.
- clean
    Removes all files generated by other targets.


Diagnostic tools
================

Setting environment variable PYUNO_LOGLEVEL=ARGS before starting LibreOffice
causes debug information from PyUNO to be printed to stderr.

Setting environment variable DIVVUN_DEBUG to any value before starting
LibreOffice causes debug output from this extension to be printed to stderr.

To debug possible initialization errors in production builds, try listing
spelling suggestions for string "DivvunGetStatusInformation". This will
return a string that contains all successfully initialized languages
and failed initializations along with error messages from libdivvun.


Bug reports and patches
=======================

Patches and bug reports can be sent to the author ([email protected]). The web
site for libreoffice-divvun is located at http://divvun.no


Change history
==============

Version 2.0 was an almost total rewrite of the previous version 1.2. This
version was designed to work well with libvoikko and aimed to use the best
current practices for OpenOffice.org extension development. The old code
was based on the internals of OpenOffice.org 1.0 and designed to work with
a non-free Finnish spellchecking library.

Version 3.0 added support for grammar checking. Version 3.2 added support
for spell checking in languages other than Finnish.

Version 4.0 extended support for grammar checkers and hyphenators to any
language. The license was changed from GPL to MPL.

Version 5.0 changed the implementation language from C++ to Python in
order to make the extension code platform independent.

For more detailed changes since 2.0 see ChangeLog.

libreoffice-divvun's People

Contributors

hatapitk avatar unhammer avatar snomos avatar flammie avatar mikaeli avatar reneengelhard avatar

Stargazers

 avatar Brendan Molloy avatar

Watchers

 avatar Børre Gaup avatar Brendan Molloy avatar James Cloos avatar  avatar  avatar

libreoffice-divvun's Issues

Grammar checker should also use speller API

Since the grammar checker is also doing spelling, it should also use the speller API's of LibreOffice. This has several benefits:

  • we can do away with the standard speller, which means less downloads/installations
  • with no external speller, we don't risk the speller creating noise / false alarms or in general behaving worse than the grammar checker+speller; this is true especially when it comes to tokenisation (see example below)
  • unless anounced as a speller, LO will not indicate that there are proofing tools unless also the speller is installed, thus we need to announce the grammar checker as speller to make sure that users are aware that there are proofing tools installed
  • speller suggestions coming from the grammar checker are usually much better, and will thus create an improved user experience:
    • some suggestions are removed by cg rules based on context
    • for all misspellings being recognised and analysed with an error tag, we can generate only the expected suggestion, nothing else

As an example of issues we get away with using this approach, consider this sentence:

Sámedikki kultur- ja valáštallanstipeanddat

The regular speller will mistokenise kultur- and only see kultur, which it does not recognise and thus gives a red underline. The grammar checker tokeniser, on the other hand, does it correct, recognises the full form kultur-, and sees that it is correct. No underline added.

The grammar checker should use the API such that only errors tagged with &typos are provided to the speller API (offsets for redlining, list of suggestions).

Language settings > Divvun has no language selection menu

See attached screen shot. What happens when a user has grammar checkers for two languages installed? Are the settings for both merged into one big list, or is just one listed?

Such a language drop down menu is also useful to verify which languages have been installed correctly.

image

crashes LO on update from GUI

After updating the .oxt from the GUI, LO crashes with this (I had export DIVVUN_DEBUG=1 PYUNO_LOGLEVEL=ARGS in the terminal first):

2019-08-22 15:07:26,062 [CALL,tid 2342927]: try     uno->py[0x165d7d2e8].getTypes()
2019-08-22 15:07:26,062 [CALL,tid 2342927]: success uno->py[0x165d7d2e8].getTypes()=([]any){ (any){ (type)com.sun.star.lang.XServiceName }, (any){ (type)com.sun.star.lang.XServiceDisplayName }, (any){ (type)com.sun.star.linguistic2.XSupportedLocales }, (any){ (type)com.sun.star.lang.XTypeProvider }, (any){ (type)com.sun.star.lang.XServiceInfo }, (any){ (type)com.sun.star.linguistic2.XProofreader } }
2019-08-22 15:07:26,062 [CALL,tid 2342927]: success uno->py[0x165d7d2e8].getLocales()=([]any){ (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"JM", Variant = (string)"" } }, (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"ZA", Variant = (string)"" } }, (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"TT", Variant = (string)"" } }, (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"PH", Variant = (string)"" } }, (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"NA", Variant = (string)"" } }, (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"NZ", Variant = (string)"" } }, (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"US", Variant = (string)"" } }, (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"GB", Variant = (string)"" } }, (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"IN", Variant = (string)"" } }, (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"AU", Variant = (string)"" } }, (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"GH", Variant = (string)"" } }, (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"CA", Variant = (string)"" } }, (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"IE", Variant = (string)"" } }, (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"BS", Variant = (string)"" } }, (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"ZW", Variant = (string)"" } }, (any){ (com.sun.star.lang.Locale){ Language = (string)"en", Country = (string)"BZ", Variant = (string)"" } } }
2019-08-22 15:07:26,089 [CALL,tid 2344792]: Instantiating pyuno bridge
2019-08-22 15:07:26,131 [CALL,tid 2344792]: try     uno->py[0x10c26cd30].activate((string)"divvun.GrammarChecker", (string)"", (string)"file:///Users/unhammer/Library/Application%20Support/LibreOffice/4/user/uno_packages/cache/uno_packages/lu263364ms9m3.tmp_/2019-08-22-divvun.oxt/lodivvun.py", (com.sun.star.registry.XRegistryKey)0x0)
22-08-2019:15:07:26,163 DEBUG    [lodivvun.py:30] sys.path: ['/Applications/LibreOffice.app/Contents/Frameworks/LibreOfficePython.framework/Versions/Current/lib/python3.5', '/Applications/LibreOffice.app/Contents/Frameworks/LibreOfficePython.framework/Versions/Current/lib/python3.5/lib-dynload', '/Applications/LibreOffice.app/Contents/Frameworks/LibreOfficePython.framework/Versions/Current/lib/python3.5/lib-tk', '/Applications/LibreOffice.app/Contents/Frameworks/LibreOfficePython.framework/Versions/Current/lib/python3.5/site-packages', '/Applications/LibreOffice.app/Contents/Resources', '/Users/unhammer', '/Applications/LibreOffice.app/Contents/Frameworks/LibreOfficePython.framework/lib/python35.zip', '/Applications/LibreOffice.app/Contents/Frameworks/LibreOfficePython.framework/lib/python3.5', '/Applications/LibreOffice.app/Contents/Frameworks/LibreOfficePython.framework/lib/python3.5/plat-darwin', '/Applications/LibreOffice.app/Contents/Frameworks/LibreOfficePython.framework/lib/python3.5/lib-dynload', '/Users/unhammer/Library/Application Support/LibreOffice/4/user/uno_packages/cache/uno_packages/lu263364ms9m3.tmp_/2019-08-22-divvun.oxt/pythonpath']
22-08-2019:15:07:26,175 DEBUG    [LibLoad.py:58] Loading C libraries from search path /Users/unhammer/Library/Application Support/LibreOffice/4/user/uno_packages/cache/uno_packages/lu263364ms9m3.tmp_/2019-08-22-divvun.oxt/divvun/Darwin-64bit-
22-08-2019:15:07:26,208 DEBUG    [lodivvun.py:42] libdivvun.searchPaths(): ['/Users/unhammer/.config/voikko/4', '/Users/unhammer/.voikko/4', '/usr/local/share/voikko/4', '/usr/share/voikko/4']
22-08-2019:15:07:26,249 DEBUG    [PropertyManager.py:132] PropertyManager.getInstallationPath: '/Users/unhammer/Library/Application Support/LibreOffice/4/user/uno_packages/cache/uno_packages/lu263364ms9m3.tmp_/2019-08-22-divvun.oxt/'
22-08-2019:15:07:26,256 DEBUG    [DivvunHandlePool.py:504] DivvunHandlePool.setInstallationPath: library search path is /Users/unhammer/Library/Application Support/LibreOffice/4/user/uno_packages/cache/uno_packages/lu263364ms9m3.tmp_/2019-08-22-divvun.oxt/divvun/Darwin-64bit-
22-08-2019:15:07:26,256 DEBUG    [PropertyManager.py:28] PropertyManager.__init__
22-08-2019:15:07:26,256 DEBUG    [PropertyManager.py:224] PropertyManager.getRegistryProperties: /no.divvun.gramcheck.Config/dictionary
2019-08-22 15:07:26,257 [CALL,tid 2344792]: try     py->uno[0x7ffd21e8a770].createInstanceWithContext((string)"com.sun.star.configuration.ConfigurationProvider", (com.sun.star.uno.XComponentContext)0x7ffd2390abf0)
2019-08-22 15:07:26,265 [CALL,tid 2344792]: success py->uno[0x7ffd21e8a770].createInstanceWithContext()=(com.sun.star.uno.XInterface)0x7ffd239535e8
2019-08-22 15:07:26,266 [CALL,tid 2344792]: try     py->uno[0x7ffd21f00020].createInstanceWithArguments((string)"com.sun.star.configuration.ConfigurationUpdateAccess", ([]any){ (any){ (com.sun.star.beans.PropertyValue){ Name = (string)"nodepath", Handle = (long)0x0, Value = (any){ (string)"/no.divvun.gramcheck.Config/dictionary" }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE } } })
2019-08-22 15:07:26,350 [CALL,tid 2344792]: success py->uno[0x7ffd21f00020].createInstanceWithArguments()=(com.sun.star.uno.XInterface)0x7ffd02e0f320
2019-08-22 15:07:26,352 [CALL,tid 2344792]: try     py->uno[0x7ffd21cf6580].getHierarchicalPropertyValue((string)"variant")
2019-08-22 15:07:26,352 [CALL,tid 2344792]: success py->uno[0x7ffd21cf6580].getHierarchicalPropertyValue()=(string)"standard"
22-08-2019:15:07:26,352 DEBUG    [PropertyManager.py:39] Initial dictionary variant 'standard'
22-08-2019:15:07:26,352 DEBUG    [PropertyManager.py:68] PropertyManager.initialize: starting
22-08-2019:15:07:26,352 DEBUG    [PropertyManager.py:224] PropertyManager.getRegistryProperties: org.openoffice.Office.Linguistic/General
2019-08-22 15:07:26,353 [CALL,tid 2344792]: try     py->uno[0x7ffd21cf6580].createInstanceWithContext((string)"com.sun.star.configuration.ConfigurationProvider", (com.sun.star.uno.XComponentContext)0x7ffd2390abf0)
2019-08-22 15:07:26,353 [CALL,tid 2344792]: success py->uno[0x7ffd21cf6580].createInstanceWithContext()=(com.sun.star.uno.XInterface)0x7ffd239535e8
2019-08-22 15:07:26,353 [CALL,tid 2344792]: try     py->uno[0x7ffd21cf53a0].createInstanceWithArguments((string)"com.sun.star.configuration.ConfigurationUpdateAccess", ([]any){ (any){ (com.sun.star.beans.PropertyValue){ Name = (string)"nodepath", Handle = (long)0x0, Value = (any){ (string)"org.openoffice.Office.Linguistic/General" }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE } } })
2019-08-22 15:07:26,353 [CALL,tid 2344792]: success py->uno[0x7ffd21cf53a0].createInstanceWithArguments()=(com.sun.star.uno.XInterface)0x7ffd02e23ae0
2019-08-22 15:07:26,353 [CALL,tid 2344792]: try     py->uno[0x7ffd21cf62c0].getHierarchicalPropertyValue((string)"UILocale")
2019-08-22 15:07:26,353 [CALL,tid 2344792]: success py->uno[0x7ffd21cf62c0].getHierarchicalPropertyValue()=(string)""
22-08-2019:15:07:26,353 DEBUG    [PropertyManager.py:55] Specified UI locale = ''
22-08-2019:15:07:26,353 DEBUG    [PropertyManager.py:62] Locale language = 'en_NO'
2019-08-22 15:07:26,353 [CALL,tid 2344792]: try     py->uno[0x7ffd02e22540].createInstanceWithContext((string)"com.sun.star.linguistic2.LinguProperties", (com.sun.star.uno.XComponentContext)0x7ffd2390abf0)
2019-08-22 15:07:26,368 [CALL,tid 2344792]: success py->uno[0x7ffd02e22540].createInstanceWithContext()=(com.sun.star.uno.XInterface)0x7ffd02e29310
2019-08-22 15:07:26,370 [CALL,tid 2344792]: try     py->uno[0x7ffd02e424b0].addPropertyChangeListener((string)"IsSpellWithDigits", (com.sun.star.uno.XInterface)0x7ffd02e4fad8)
2019-08-22 15:07:26,370 [CALL,tid 2344792]: success py->uno[0x7ffd02e424b0].addPropertyChangeListener()=void
2019-08-22 15:07:26,370 [CALL,tid 2344792]: try     py->uno[0x7ffd02e424b0].addPropertyChangeListener((string)"IsSpellUpperCase", (com.sun.star.uno.XInterface)0x7ffd02e4fad8)
2019-08-22 15:07:26,370 [CALL,tid 2344792]: success py->uno[0x7ffd02e424b0].addPropertyChangeListener()=void
22-08-2019:15:07:26,370 DEBUG    [PropertyManager.py:85] PropertyManager.initialize: property manager initalized
2019-08-22 15:07:26,370 [CALL,tid 2344792]: try     py->uno[0x7ffd02e424b0].getPropertyValue((string)"IsSpellWithDigits")
2019-08-22 15:07:26,372 [CALL,tid 2344792]: except  py->uno[0x7ffd02e424b0].getPropertyValue = (com.sun.star.uno.DeploymentException){ (com.sun.star.uno.RuntimeException){ (com.sun.star.uno.Exception){ Message = (string)"null process service factory", Context = (com.sun.star.uno.XInterface)0x0 } } }
22-08-2019:15:07:26,373 WARNING  [lodivvun.py:90] Traceback (most recent call last):

  File "/Users/unhammer/Library/Application Support/LibreOffice/4/user/uno_packages/cache/uno_packages/lu263364ms9m3.tmp_/2019-08-22-divvun.oxt/lodivvun.py", line 69, in <module>
    PropertyManager.getInstance()

  File "/Users/unhammer/Library/Application Support/LibreOffice/4/user/uno_packages/cache/uno_packages/lu263364ms9m3.tmp_/2019-08-22-divvun.oxt/pythonpath/LODivvun/PropertyManager.py", line 238, in getInstance
    PropertyManager.instance = PropertyManager()

  File "/Users/unhammer/Library/Application Support/LibreOffice/4/user/uno_packages/cache/uno_packages/lu263364ms9m3.tmp_/2019-08-22-divvun.oxt/pythonpath/LODivvun/PropertyManager.py", line 43, in __init__
    self.initialize()

  File "/Users/unhammer/Library/Application Support/LibreOffice/4/user/uno_packages/cache/uno_packages/lu263364ms9m3.tmp_/2019-08-22-divvun.oxt/pythonpath/LODivvun/PropertyManager.py", line 88, in initialize
    self.__setProperties(self.__linguPropSet)

  File "/Users/unhammer/Library/Application Support/LibreOffice/4/user/uno_packages/cache/uno_packages/lu263364ms9m3.tmp_/2019-08-22-divvun.oxt/pythonpath/LODivvun/PropertyManager.py", line 178, in __setProperties
    pValue.Value = properties.getPropertyValue(p)

LODivvun.PropertyManager.com.sun.star.uno.DeploymentException: null process service factory

2019-08-22 15:07:26,373 [CALL,tid 2344792]: try     py->uno[0x7ffd02e53310].createInstance((string)"com.sun.star.awt.Toolkit")
2019-08-22 15:07:26,453 [CALL,tid 2344792]: success py->uno[0x7ffd02e53310].createInstance()=(com.sun.star.uno.XInterface)0x7ffd239afb20
2019-08-22 15:07:26.454 uno[26376:2344817] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'nextEventMatchingMask should only be called from the Main Thread!'
*** First throw call stack:
(
        0   CoreFoundation                      0x00007fff31088439 __exceptionPreprocess + 256
        1   libobjc.A.dylib                     0x00007fff5b7fc3c6 objc_exception_throw + 48
        2   AppKit                              0x00007fff2e5b9f8e -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 4180
        3   libvcllo.dylib                      0x00000001132a5751 _ZN15AquaSalInstance7DoYieldEbb + 609
        4   libvcllo.dylib                      0x000000011321e93b _ZN11Application7ExecuteEv + 331
        5   libtklo.dylib                       0x000000011492a778 _ZN12_GLOBAL__N_1L21ToolkitWorkerFunctionEPv + 328
        6   libvcllo.dylib                      0x00000001132248cf _ZL18MainWorkerFunctionPv + 15
        7   libuno_sal.dylib.3                  0x000000010a831d0e _ZL21osl_thread_start_ImplPv + 126
        8   libsystem_pthread.dylib             0x00007fff5d1b52eb _pthread_body + 126
        9   libsystem_pthread.dylib             0x00007fff5d1b8249 _pthread_start + 66
        10  libsystem_pthread.dylib             0x00007fff5d1b440d thread_start + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException


Fatal exception: Signal 6
Stack:
/Applications/LibreOffice.app/Contents/Frameworks/libuno_sal.dylib.3+0x37ac2(_ZN12_GLOBAL__N_110printStackEi+0x32)[0x10a82eac2]
/Applications/LibreOffice.app/Contents/Frameworks/libuno_sal.dylib.3+0x379ac(_ZN12_GLOBAL__N_121signalHandlerFunctionEiP9__siginfoPv+0x2ec)[0x10a82e9ac]
/usr/lib/system/libsystem_platform.dylib+0x4b5d(_sigtramp+0x1d)[0x7fff5d1acb5d]
/usr/lib/libc++abi.dylib+0x109c5(GCC_except_table51+0x105)[0x7fff5a2589c5]
/usr/lib/system/libsystem_c.dylib+0x5b6a6(abort+0x7f)[0x7fff5d0666a6]
/usr/lib/libc++abi.dylib+0x3641(__cxa_bad_cast+0x0)[0x7fff5a24b641]
/usr/lib/libc++abi.dylib+0x37df(_ZL26default_unexpected_handlerv+0x0)[0x7fff5a24b7df]
/usr/lib/libobjc.A.dylib+0x1677b(_ZL15_objc_terminatev+0x61)[0x7fff5b7fe77b]
/usr/lib/libc++abi.dylib+0xf19e(_ZSt11__terminatePFvvE+0x8)[0x7fff5a25719e]
/usr/lib/libc++abi.dylib+0xef86(__cxa_get_exception_ptr+0x0)[0x7fff5a256f86]
/usr/lib/libc++abi.dylib+0x1f99(__cxa_get_globals+0x0)[0x7fff5a249f99]
/usr/lib/libobjc.A.dylib+0x14507(objc_exception_throw+0x171)[0x7fff5b7fc507]
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit+0x19f8e(-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]+0x1054)[0x7fff2e5b9f8e]
/Applications/LibreOffice.app/Contents/Frameworks/libvcllo.dylib+0x3ea751(_ZN15AquaSalInstance7DoYieldEbb+0x261)[0x1132a5751]
/Applications/LibreOffice.app/Contents/Frameworks/libvcllo.dylib+0x36393b(_ZN11Application7ExecuteEv+0x14b)[0x11321e93b]
/Applications/LibreOffice.app/Contents/Frameworks/libtklo.dylib+0x38778(_ZN12_GLOBAL__N_1L21ToolkitWorkerFunctionEPv+0x148)[0x11492a778]
/Applications/LibreOffice.app/Contents/Frameworks/libvcllo.dylib+0x3698cf(_ZL18MainWorkerFunctionPv+0xf)[0x1132248cf]
/Applications/LibreOffice.app/Contents/Frameworks/libuno_sal.dylib.3+0x3ad0e(_ZL21osl_thread_start_ImplPv+0x7e)[0x10a831d0e]
/usr/lib/system/libsystem_pthread.dylib+0x32eb(_pthread_body+0x7e)[0x7fff5d1b52eb]
/usr/lib/system/libsystem_pthread.dylib+0x6249(_pthread_start+0x42)[0x7fff5d1b8249]
/usr/lib/system/libsystem_pthread.dylib+0x240d(thread_start+0xd)[0x7fff5d1b440d]
Application Error

Fatal exception: Signal 6
Stack:
/Applications/LibreOffice.app/Contents/Frameworks/libuno_sal.dylib.3+0x37ac2(_ZN12_GLOBAL__N_110printStackEi+0x32)[0x10f2b1ac2]
/Applications/LibreOffice.app/Contents/Frameworks/libuno_sal.dylib.3+0x379ac(_ZN12_GLOBAL__N_121signalHandlerFunctionEiP9__siginfoPv+0x2ec)[0x10f2b19ac]
/usr/lib/system/libsystem_platform.dylib+0x4b5d(_sigtramp+0x1d)[0x7fff5d1acb5d]
Abort trap: 6

Inconsistensies between LO and command line: no space after punctuation

The following command gives no indication of trouble:

$ printf '– Mu bárdni áigu šaddat doavttirin.\n– Lea go son álgán doavttirskuvlii?\n' | tools/grammarcheckers/modes/trace-smegram1-blanktag.mode 
[...]
: 
"<doavttirin>"
	"doavttir" N Sem/Hum Ess <W:0.0>
"<.>"
	"." CLB <W:0.0>
:\n
"<–>"
	"–" PUNCT <W:0.0> <firstWordOfParagraph>
: 
[...]

But still, when the same files are used in LO, there are tiny blue underlines under the final full stop of a sentence:

image

Because of this inconstancy I am not able to fix it - there is nothing to fix in the data I have access to.

Overlapping errors kill the blue underline, create bad corrections

Check the following screen shots:

  1. Missing space after parenthesis, the following word correctly spelled - error detected and with a proper correction compared to the blue underline:

Skjermbilde 2019-09-12 kl  12 12 24

  1. The following word misspelled, but now with a space after the parenthesis - misspelling detected and corrected as it should:

Skjermbilde 2019-09-12 kl  12 12 44

  1. No space after the parenthesis, AND the following word misspelled - the blue underline is now only on the parenthesis, making it hard to see and hit:

Skjermbilde 2019-09-12 kl  12 14 44

  1. ... but worse, the suggestion is still as if the blue underline covers the following word:

Skjermbilde 2019-09-12 kl  12 13 09

  1. ... which leads to the corrected text becoming meaningless:

Skjermbilde 2019-09-12 kl  12 13 25

The bug is restricted to LO. The command line interface properly suppresses the second of the two overlapping errors:

$ echo 'Vuoigatvuođa Lávdegotti (SVL)čilghus' | divvun-checker -a se.zcheck | jq .
{
  "errs": [
    [
      ")čilghus",
      28,
      36,
      "no-space-after-parent-end",
      "[SE] Parenthesis missing space",
      [
        ") čilgehus"
      ],
      "[SE] Parenthesis missing space"
    ]
  ],
  "text": "Vuoigatvuođa Lávdegotti (SVL)čilghus"
}

The zcheck file is available for download for a limited time.

Env.: newest of everything (hfst, vislcg3, libdivvun, etc).

Grammar checker has no language setting for one language

Error message on:
https://pastebin.com/XiYJiMtS

Relevant line (pace Sjur):

2019-03-04 16:28:16,340 [CALL,tid 5187294]: except uno->py[0x15f7e0390].createInstanceWithContext = (com.sun.star.uno.RuntimeException){ (com.sun.star.uno.Exception){ Message = (string)"<class 'TypeError'>: 'SwigPyObject' object is not iterable, traceback follows

Sjur:

  • der er det ein feil frå innstillingane til grammatikkontrollen. Truleg det som gjer at lista er tom hjå Trond.

Divvun settings are empty

The LO grammar checker does not seem to work, and one indication of this is an empty settings page:

Bilde 06 02 2020 klokken 14 23

When run from the command line, I get the following debug info:

$ export PYUNO_LOGLEVEL=ARGS DIVVUN_DEBUG=1
$ /Applications/LibreOffice.app/Contents/MacOS/soffice 
2020-02-06 14:02:57,263 [CALL,tid 2386944]: Instantiating pyuno bridge
2020-02-06 14:02:57,351 [CALL,tid 2386944]: try     uno->py[0x18e9a1cc0].activate((string)"voikko.SpellChecker", (string)"", (string)"file:///Applications/LibreOffice.app/Contents/Resources/uno_packages/cache/uno_packages/lu487392s3y0q.tmp_/voikko-5.0.oxt/lovoikko.py", (com.sun.star.registry.XRegistryKey)0x0)
[...]
2020-02-06 14:03:17,686 [CALL,tid 2386944]: try     py->uno[0x7fd8b95ec0a0].createInstanceWithArguments((string)"com.sun.star.configuration.ConfigurationAccess", ([]any){ (any){ (com.sun.star.beans.PropertyValue){ Name = (string)"nodepath", Handle = (long)0x0, Value = (any){ (string)"/org.openoffice.Setup/L10N" }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE } } })
2020-02-06 14:03:17,686 [CALL,tid 2386944]: success py->uno[0x7fd8b95ec0a0].createInstanceWithArguments()=(com.sun.star.uno.XInterface)0x7fd8b95ecc30
2020-02-06 14:03:17,687 [CALL,tid 2386944]: try     py->uno[0x7fd8b95e09c0].getByName((string)"ooLocale")
2020-02-06 14:03:17,687 [CALL,tid 2386944]: success py->uno[0x7fd8b95e09c0].getByName()=(string)"nn"
INFO:root:KBU: uilocale (com.sun.star.lang.Locale){ Language = (string)"nn", Country = (string)"", Variant = (string)"" }
2020-02-06 14:03:17,690 [CALL,tid 2386944]: except  uno->py[0x1ab1aff60].createInstanceWithContext = (com.sun.star.uno.RuntimeException){ (com.sun.star.uno.Exception){ Message = (string)"<class 'UnboundLocalError'>: local variable 'checklang' referenced before assignment, traceback follows
  File "/Applications/LibreOffice.app/Contents/Resources/unohelper.py", line 292, in createInstanceWithContext
    return self.clazz( context )
  File "/Users/smo036/Library/Application Support/LibreOffice/4/user/uno_packages/cache/uno_packages/lu50712uro8w.tmp_/divvun.oxt/pythonpath/LODivvun/SettingsEventHandler.py", line 128, in __init__
    self.__initToggleIds()
  File "/Users/smo036/Library/Application Support/LibreOffice/4/user/uno_packages/cache/uno_packages/lu50712uro8w.tmp_/divvun.oxt/pythonpath/LODivvun/SettingsEventHandler.py", line 134, in __initToggleIds
    self.__toggleIds = getToggleIds()
  File "/Users/smo036/Library/Application Support/LibreOffice/4/user/uno_packages/cache/uno_packages/lu50712uro8w.tmp_/divvun.oxt/pythonpath/LODivvun/SettingsEventHandler.py", line 86, in getToggleIds
    logging.info("KBU: prefs of checker for lang {} has toggleIds {}".format(checklang, toggleIds))

", Context = (com.sun.star.uno.XInterface)0x0 } }

crashes LO if cg-proc can't load grammar

using a too new zcheck without updating the plugin bundle results in Error: Grammar revision is 13145, but this loader only knows up to revision 12795! and crashes all of LO

grammar checker settings should expose available pipelines

In the Divvun settings pane, in addition to the various errors one can (de)select, one should in addition be able to select the pipeline to run. This can be used to offer pipelines with other types of functionality, or targeted at other user groups (e.g. L2 vs L1). One could also differentiate the various pipelines as being public, beta, or closed, and have an option for displaying experimental (=beta) pipelines. Closed ones should never be available in the LO settings window (but can be tested on the command line).

Speller suggestion order different from command line, does not follow weight

This is the order using a modes shell script (including suggestion weight):

$ echo "Eat ge mii liiko go skuvllat bidjojuvvojit vuostálagaid." | tools/grammarcheckers/modes/smegram.mode
"<Eat>"
	"ii" <aux> V IV Neg Ind Pl1 <W:0.0> @+FAUXV
: 
"<ge>"
	"ge" Pcle <W:0.0> @PCLE
: 
"<mii>"
	"mii" Pron Indef Sg Nom <W:0.0> @SUBJ>
	"mii" Pron Rel Sg Nom <W:0.0> @SUBJ>
: 
"<liiko>"
	"liikot" <mv> V <EX-Nom-Ani> <TH-Inf> <TH-jus> <TH-go> <TH-ahte> <TH-Ill-Any> <XT-Adv-Xt> IV Ind Prs Sg3 <W:0.0> @FS-<ADVL
: 
"<go>"
	"go" CS <W:0.0> @CVP
: 
"<skuvllat>"
	"skuvla" N Sem/Edu_Org Pl Nom <W:0.0> @SUBJ>
: 
"<bidjojuvvojit>"
	"bidjat" Ex/V Ex/TV Der/PassL V IV Ind Prs Pl3 <W:9.65234> <WA:11.6523> <spelled> "<biddjojuvvojit>" &SUGGESTWF &typo
typo
	"bidjat" Ex/V Ex/TV Der/PassL V IV Ind Prt Sg2 <W:9.65234> <WA:11.6523> <spelled> "<biddjojuvvojit>" &SUGGESTWF &typo
typo
	"bieđđat" Ex/V Ex/IV Der/PassL V IV Ind Prs Pl3 <W:19.3018> <WA:17.3018> <spelled> "<biđđojuvvojit>" &SUGGESTWF &typo
typo
	"biđđit" Ex/V Ex/TV Der/PassL V IV Ind Prs Pl3 <W:19.3018> <WA:17.3018> <spelled> "<biđđojuvvojit>" &SUGGESTWF &typo
typo
	"biddut" Ex/V Ex/IV Der/PassL V IV Ind Prs Pl3 <W:23.6084> <WA:15.6084> <spelled> "<biddojuvvojit>" &SUGGESTWF &typo
typo
: 
"<vuostálagaid>"
	"vuostálagaid" Adv <W:0.0>
	"vuostálat" N Sem/Plc Err/Orth Pl Acc <W:0.0> @<OBJ
	"vuostálat" N Sem/Plc Pl Acc <W:0.0> @<OBJ
"<.>"
	"." CLB <W:0.0>
:\n

And this is the output of the divvun-checker tool:

$ echo "Eat ge mii liiko go skuvllat bidjojuvvojit vuostálagaid." | divvun-checker -a tools/grammarcheckers/se.zcheck | jq .
{
  "errs": [
    [
      "bidjojuvvojit",
      29,
      42,
      "typo",
      "Ii leat sátnelisttus",
      [
        "biddjojuvvojit",
        "biđđojuvvojit",
        "biddojuvvojit"
      ],
      "Čállinmeattáhusat"
    ]
  ],
  "text": "Eat ge mii liiko go skuvllat bidjojuvvojit vuostálagaid."
}

The order of the speller suggestions is the same, and follows the weight of the suggestions. But then in LO it looks like this:

Skjermbilde 2019-03-18 kl  17 08 11

https://filebin.net/mvvnmqgal0 will soon contain the newest se.zcheck used for this (as soon as filebin decides to cooperate).

Otherwise using the latest of everything, AFAIK.

How do I choose which language to get feedback messages in?

Presently the feedback messages are made in two versions, one sme and and one eng. But there is no way to select the wanted interface language for these messages. The actual messages in the grammar checker interface are in sme, while the error type listing in Language settings > Divvun are in English. See screenshot. One possible solution would be to have a separate drop-down menu in the settings page (specific to the grammar checker language, ie one setting for sme, another for smj, a third for the sma grammar checker).

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.