Skip to content
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.

Spellchecking #100 #120

Closed
wants to merge 19 commits into from
Closed

Spellchecking #100 #120

wants to merge 19 commits into from

Conversation

msteinbeck
Copy link

This is a first version of spell checking (only works on linux and maybe mac, since i have no windows machine available to compile hunspell as static lib). It also provides the feature to replace a misspelled word with a suggested word. The spell checking itself can be used on any QTextDocument.

I had some trouble to add a dictionary to the rcc file therefore i used a static path to "/usr/share/hunspell/en_US.aff" and "/usr/share/hunspell/en_US.dic". Furthermore I am not sure whether we should bundle some dictionaries or use the system one. The second option causes some extra work for windows clients, so I would recommend to bundle the common languages

marcel added 3 commits May 16, 2014 09:44
- use spellchecking in inputtextwidget and provide a suggestion list
stream/master'

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@nurupo
Copy link
Owner

nurupo commented May 17, 2014

Could you add the hunspell library to the .travis.yml file so that Travis-CI could build the PR?

#include <QString>
#include <QStringList>
#include <QStringListIterator>
#include <QRegExp>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nurupo
Copy link
Owner

nurupo commented May 19, 2014

Tested with hunspell on Windows. It works, but requires some improvements. For example:

  • The suggestion words are added at the very bottom of the context menu, with the best suggestion at the very bottom, going up to the worst suggestion.
  • In order to check a word, user should have so called "I-beam" cursor at the word, you can't just right-click any word.to check.
  • It marks words that you currently didn't finish typing as incorrect.

I think it's a bit fresh for merging into the master as, how you name it "first version".

Making suggestion show at the top of the context menu popup in reverse order of what it is now, allowing to right-click on a word where we don't have the I-beam cursor blinking (well, that one actually can be added later) and adapting the code from the link mentioned in #100 (comment) instead of writing own from the bottom up should make it merge-able.
Not sure if you are going to work on it or not, you didn't reply to any comments. I could move your commit to another branch, make improvements myself and then merge with master, though I have other PRs to take care of first. I bet @Schlumpf is angry on me for not doing anything with his PRs yet : )

@Schlumpf
Copy link
Contributor

@nurupo :( What's wrong with my PRs?

@msteinbeck
Copy link
Author

Of course I will continue working on this ticket. The reason that i didn't replay your comments were simply that I visited a friend over the weekend. Could you send me, or simply add a pull request for the windows lib of hunspell?

I will fix the suggestions list asap (maybe today). I also could add some dictionaries for common language to the repository.

@msteinbeck
Copy link
Author

[...] Could you add the hunspell library to the .travis.yml file so that Travis-CI could build the PR? [...]

I'm not familiar with Travis-Cl. Do i have to simply wget the package and add the include path?

@ghost
Copy link

ghost commented May 19, 2014

@ReTuXx You just do what you would've done using bash.
I.e. :

before_install:
  - wget pack.tar.xz https://link.wot/pack.tar.xz > /dev/null
  - tar xJf pack.tar.xz > /dev/null
  - cd pack
  - ./configure  > /dev/null
  - make && make install  > /dev/null

@ghost
Copy link

ghost commented May 19, 2014

Check if the libhunspell is in the right PATH

@msteinbeck
Copy link
Author

Installing hunspell from apt should be the easiest way :)

@nurupo
Copy link
Owner

nurupo commented May 19, 2014

Could you send me, or simply add a pull request for the windows lib of hunspell?

That's a bit nasty -- creating a branch to send you a PR that will be added to the PR you are making to me that will end up back in one of my branches. Anyway, here it is a small patch https://github.com/retuxx/ProjectTox-Qt-GUI/pull/1, read the comment on it.

@msteinbeck
Copy link
Author

I finished the spell checker. As far as I can see I fixed all your announcements. Nevertheless a dialog for setting up the preferred language is missing but depends on #116.

@nurupo
Copy link
Owner

nurupo commented May 21, 2014

I finished the spell checker. As far as I can see I fixed all your announcements.

Thanks : )

Nevertheless a dialog for setting up the preferred language is missing but depends on #116.

Could you explain how it depends on the new message display?

@msteinbeck
Copy link
Author

I misread the the topic of this PR and thought it contains a new settings dialog

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants