Commit dd0fc7c8 authored by Alexander Rezepkin's avatar Alexander Rezepkin Committed by Commit Bot

[Hunspell] Reduce maximum suggestions from 15 to 5.

Before this patch, the maximum number of suggestions within Hunspell
was 15, although Chrome uses only 5 suggestions.
See: https://cs.chromium.org/chromium/src/components/spellcheck/common/spellcheck_common.h?l=22&rcl=a88c5fe6e641bdc9cb84b64ddb90ead67e0d0bcc

So when a misspelled word has more than 5 suggestions, Hunspell does
a useless job and searches for suggestions that will never be used.

This patch reduces from 15 to 5 the maximum number of searched
suggestions within Hunspell.

Bug: NONE
Change-Id: I68054cfc161ec509c99a620de2b0e5252576853c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863298
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706478}
parent 62057f50
...@@ -41,6 +41,7 @@ Alex Henrie <alexhenrie24@gmail.com> ...@@ -41,6 +41,7 @@ Alex Henrie <alexhenrie24@gmail.com>
Alex Scheele <alexscheele@gmail.com> Alex Scheele <alexscheele@gmail.com>
Alexander Douglas <agdoug@amazon.com> Alexander Douglas <agdoug@amazon.com>
Alexander Guettler <alexander@guettler.io> Alexander Guettler <alexander@guettler.io>
Alexander Rezepkin <etu@vivaldi.net>
Alexander Shalamov <alexander.shalamov@intel.com> Alexander Shalamov <alexander.shalamov@intel.com>
Alexander Sulfrian <alexander@sulfrian.net> Alexander Sulfrian <alexander@sulfrian.net>
Alexandre Abreu <wiss1976@gmail.com> Alexandre Abreu <wiss1976@gmail.com>
......
...@@ -1042,7 +1042,7 @@ diff --git a/src/hunspell/hunspell.hxx b/src/hunspell/hunspell.hxx ...@@ -1042,7 +1042,7 @@ diff --git a/src/hunspell/hunspell.hxx b/src/hunspell/hunspell.hxx
index 43af66b..a35df83 100644 index 43af66b..a35df83 100644
--- a/src/hunspell/hunspell.hxx --- a/src/hunspell/hunspell.hxx
+++ b/src/hunspell/hunspell.hxx +++ b/src/hunspell/hunspell.hxx
@@ -79,6 +79,10 @@ @@ -79,9 +79,13 @@
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -1052,7 +1052,12 @@ index 43af66b..a35df83 100644 ...@@ -1052,7 +1052,12 @@ index 43af66b..a35df83 100644
+ +
#define SPELL_XML "<?xml?>" #define SPELL_XML "<?xml?>"
#define MAXSUGGESTION 15 -#define MAXSUGGESTION 15
+#define MAXSUGGESTION 5
#define MAXSHARPS 5
#ifndef MAXWORDLEN
@@ -115,11 +119,17 @@ class LIBHUNSPELL_DLL_EXPORTED Hunspell { @@ -115,11 +119,17 @@ class LIBHUNSPELL_DLL_EXPORTED Hunspell {
* long path names (without the long path prefix Hunspell will use fopen() * long path names (without the long path prefix Hunspell will use fopen()
* with system-dependent character encoding instead of _wfopen()). * with system-dependent character encoding instead of _wfopen()).
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
#define SPELL_XML "<?xml?>" #define SPELL_XML "<?xml?>"
#define MAXSUGGESTION 15 #define MAXSUGGESTION 5
#define MAXSHARPS 5 #define MAXSHARPS 5
#ifndef MAXWORDLEN #ifndef MAXWORDLEN
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment