View Issue Details

IDProjectCategoryView StatusLast Update
0014421ScribusLanguage Toolspublic2017-01-20 22:10
Reportermunzirtaha Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.5.3.svn 
Target Version1.5.3 
Summary0014421: Check Spelling ... is broken for Arabic (Hunspell 1.5 is not search for by CMake)
DescriptionThe spell checking for Arabic seems to be broken. Attached is a screenshot.
Hunspell checks it properly so I guess scribus hunspell plugin is broken somehow mostly with regards to spaces or word splitting.
Steps To ReproduceTest the following text in scribus and hunspell

صف خلق خود كمثل الشمس إذ بزغت يحظى الضجيع بها نجلاء معطار
Additional InformationThe words denoted by scribus as wrong are not necessarily to be the same every time or resemble my screenshot but in all cases it's different than hunspell output.
TagsRTL, spellchecker
PatchNo

Relationships

related to 0013545 new Check spelling doesn't work 

Activities

munzirtaha

2016-12-06 13:15

reporter  

scribus-arabic-spell-bug.png (45,059 bytes)   
scribus-arabic-spell-bug.png (45,059 bytes)   

munzirtaha

2016-12-09 21:10

reporter   ~0042826

Previously, I ran scribus from an appimage. Now, I compiled from source to see what's happening and help trace it. I found that cmake couldn't find hunspell with message

-- Could NOT find HUNSPELL (missing: HUNSPELL_LIBRARIES)
Hunspell or its developer libraries NOT found - Disabling support for spell checking

Then I checked FindHUNSPELL.cmake and it only search for 1.4 and lower where as my hunspell version is 1.5.4. I am running Arch Linux

find_library(HUNSPELL_LIBRARIES NAMES hunspell-1.4 hunspell-1.3 hunspell-1.2 PATHS /opt/local/lib /usr/local/lib /usr/lib )

I tried to add it and recompile, hunspell is found and behaves much better now but still has some issues.

Attached is an image which show a correct 2-letter Arabic word and how it behaves.

I tested stand-alone hunspell with

echo 'من' |hunspell -d ar
Hunspell 1.5.4
*
scribus-issue-14421.png (95,478 bytes)   
scribus-issue-14421.png (95,478 bytes)   

Kunda

2016-12-09 21:45

updater   ~0042827

Thanks @munzirtaha
Here the line of code in question:
https://github.com/scribusproject/scribus/blob/master/cmake/modules/FindHUNSPELL.cmake#L12

find_library(HUNSPELL_LIBRARIES NAMES hunspell-1.4 hunspell-1.3 hunspell-1.2 PATHS /opt/local/lib /usr/local/lib /usr/lib )

Kunda

2016-12-09 21:54

updater   ~0042829

@jghali or @cbradney
If it's as easy as adding 'hunspell-1.5' to that line then here is the patch:
https://patch-diff.githubusercontent.com/raw/scribusproject/scribus/pull/66.diff

cbradney

2016-12-09 23:10

administrator   ~0042830

Committed

munzirtaha

2016-12-10 13:11

reporter   ~0042836

Yes, this is exactly what I did but the bug is still valid. The next image I attached is after I patched scribus so it sees hunspell new version.

BTW: couldn't you just link to libhunspell.so instead of listing every old, current and future versions of libhunspell?

Kunda

2016-12-10 21:18

updater   ~0042848

@munzirtaha
does you patch differ then the one I offered ?
Please attach it then

cbradney

2016-12-10 21:31

administrator   ~0042849

It doesnt matter Kunda, I made that change myself.

Kunda

2016-12-10 22:52

updater   ~0042850

craig, is there a reason why you're keeping support for for older Hunspell versions?
Also
> BTW: couldn't you just link to libhunspell.so instead of listing every old, current and future versions of libhunspell?

cbradney

2016-12-12 21:47

administrator   ~0042941

We link to whatever is on the system. That stuff is just cmake code to find the local lib. If someone wants to write a better hunspell finder, they can. For now, this works ok.

Kunda

2016-12-12 23:25

updater   ~0042942

@fahad can you weigh in on this issue ?

Fahad

2016-12-13 03:30

developer   ~0042947

@cbradney can we benefit from this:
https://cgit.kde.org/lokalize.git/tree/cmake/FindHUNSPELL.cmake

"
FIND_PATH(HUNSPELL_INCLUDE_DIR hunspell/hunspell.hxx )

FIND_LIBRARY(HUNSPELL_LIBRARIES NAMES hunspell-2.0 hunspell-1.5 hunspell-1.4.1 hunspell-1.4 hunspell-1.3 hunspell-1.2 hunspell)
"

munzirtaha

2016-12-13 19:37

reporter   ~0042963

My understanding is there is no need for the version numbers. You can just use

find_library(HUNSPELL_LIBRARIES NAMES hunspell PATHS /opt/local/lib /usr/local/lib /usr/lib )

After all, libhunspell.so -> libhunspell-1.5.so or whatever version on the system.

cbradney

2016-12-13 22:07

administrator   ~0042964

This bug is about spelling, not about us finding hunspell.

@Fahad.. yes, sure, our original file came from KDE based on that link I guess. Again, we just need to understand the spelling issue, not how we are finding hunspell.

munzirtaha

2016-12-15 23:41

reporter   ~0043048

The good news is this bug is resolved now. Not sure which commit fixed it but I couldn't reproduce it.

Issue History

Date Modified Username Field Change
2016-12-06 13:15 munzirtaha New Issue
2016-12-06 13:15 munzirtaha File Added: scribus-arabic-spell-bug.png
2016-12-06 13:15 munzirtaha Tag Attached: RTL
2016-12-06 15:25 Kunda Relationship added related to 0013545
2016-12-09 21:10 munzirtaha File Added: scribus-issue-14421.png
2016-12-09 21:10 munzirtaha Note Added: 0042826
2016-12-09 21:45 Kunda Note Added: 0042827
2016-12-09 21:46 Kunda Status new => confirmed
2016-12-09 21:46 Kunda Target Version => 1.5.3
2016-12-09 21:46 Kunda Summary Check Spelling ... is broken for Arabic => Check Spelling ... is broken for Arabic (Hunspell 1.5 is not search for by CMake)
2016-12-09 21:54 Kunda Note Added: 0042829
2016-12-09 21:56 Kunda Tag Attached: spellchecker
2016-12-09 23:10 cbradney Note Added: 0042830
2016-12-10 13:11 munzirtaha Note Added: 0042836
2016-12-10 21:18 Kunda Note Added: 0042848
2016-12-10 21:31 cbradney Note Added: 0042849
2016-12-10 22:52 Kunda Note Added: 0042850
2016-12-12 21:47 cbradney Note Added: 0042941
2016-12-12 23:25 Kunda Note Added: 0042942
2016-12-13 03:30 Fahad Note Added: 0042947
2016-12-13 19:37 munzirtaha Note Added: 0042963
2016-12-13 22:07 cbradney Note Added: 0042964
2016-12-15 23:41 munzirtaha Note Added: 0043048
2016-12-16 03:10 Kunda Status confirmed => resolved
2016-12-16 03:10 Kunda Resolution open => fixed
2017-01-20 22:10 cbradney Status resolved => closed