diff options
author | Nelson Benítez León <nbenitezl@gmail.com> | 2018-09-10 15:51:56 +0100 |
---|---|---|
committer | Albert Astals Cid <tsdgeos@yahoo.es> | 2018-12-09 21:29:24 +0000 |
commit | 86326030f6989c79f8dd9e91cd4c249278cdbc49 (patch) | |
tree | ebf18f4ee4c21e33cee27f43bd1227ccc9b32f69 /poppler/TextOutputDev.h | |
parent | 90a3778a8f73761c421991dca789d3a196940573 (diff) |
add new 'IgnoreDiacritics' option to ::findText()
This makes possible that simple ascii search terms
can match on their accented and other diacritics
counterparts.
This option will be ignored if the search term is
not pure Ascii.
Issue #637
Diffstat (limited to 'poppler/TextOutputDev.h')
-rw-r--r-- | poppler/TextOutputDev.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/poppler/TextOutputDev.h b/poppler/TextOutputDev.h index 28e7c304..653c8522 100644 --- a/poppler/TextOutputDev.h +++ b/poppler/TextOutputDev.h @@ -340,6 +340,9 @@ private: Unicode *normalized; // normalized form of Unicode text int normalized_len; // number of normalized Unicode chars int *normalized_idx; // indices of normalized chars into Unicode text + Unicode *ascii_translation; // ascii translation from the normalized text + int ascii_len; // length of ascii translation text + int *ascii_idx; // indices of ascii chars into Unicode text of line friend class TextLineFrag; friend class TextBlock; @@ -605,6 +608,18 @@ public: double *xMin, double *yMin, double *xMax, double *yMax); + // Adds new parameter ignoreDiacritics, which will do diacritics + // insensitive search, i.e. ignore accents, umlauts, diaeresis,etc. + // while matching. This option will be ignored if <s> contains characters + // which are not pure ascii. + bool findText(Unicode *s, int len, + bool startAtTop, bool stopAtBottom, + bool startAtLast, bool stopAtLast, + bool caseSensitive, bool ignoreDiacritics, + bool backward, bool wholeWord, + double *xMin, double *yMin, + double *xMax, double *yMax); + // Get the text which is inside the specified rectangle. GooString *getText(double xMin, double yMin, double xMax, double yMax); |