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

Reply via email to