D25495: Fix Sonnet autodetect failing on Indian langs

Michel Ludwig noreply at phabricator.kde.org
Wed Jan 1 14:58:13 GMT 2020


mludwig added a comment.


  You are right that in GuessLanguage::identify(const QString &text, const QStringList &suggestionsListIn), if a language without trigrams is not present in 'suggestionsListIn', it will never be 'guessed'.
  
  I'd suggest to move your changes to GuessLanguage::identify(const QString &text, const QStringList &suggestionsListIn) after the call to d->identify(text, d->findRuns(text)); but only add those languages for which there is a dictionary AND which don't have trigrams.
  
  There is also a bug in GuessLanguagePrivate::guessFromTrigrams(const QString &sample, const QStringList &languages): if m_minConfidence is left to its default value of '0', that function will always return an empty list. I will propose a fix shortly.
  
  The real issue behind Bug 176537 is a different one, however. On-the-fly spell checking in Kate(Part) will only check one line at a time, potentially not providing enough text for a meaningful language detection. I plan to perform the language detection inside KatePart, so that there is also feedback regading the detected language that is shown to the user, who can then also override the detected language, if desired.

REPOSITORY
  R246 Sonnet

REVISION DETAIL
  https://phabricator.kde.org/D25495

To: waqar, mludwig, cullmann
Cc: ognarb, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200101/3c5545b0/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list