style: dart format reflow (no behavior change)
This commit is contained in:
parent
cf5d302cc1
commit
e3ec855630
17 changed files with 197 additions and 139 deletions
|
|
@ -77,9 +77,24 @@ class TesseractLabelExtractor implements LabelTextExtractor {
|
|||
/// Words in an hOCR document ignored as packet boilerplate (lower-cased,
|
||||
/// accent-stripped compare). Kept deliberately small and generic.
|
||||
const _boilerplate = <String>{
|
||||
'organic', 'product', 'products', 'herb', 'herbs', 'seed', 'seeds',
|
||||
'bio', 'net', 'weight', 'wt', 'www', 'com', 'gr', 'grs', 'grams',
|
||||
'variety', 'quality',
|
||||
'organic',
|
||||
'product',
|
||||
'products',
|
||||
'herb',
|
||||
'herbs',
|
||||
'seed',
|
||||
'seeds',
|
||||
'bio',
|
||||
'net',
|
||||
'weight',
|
||||
'wt',
|
||||
'www',
|
||||
'com',
|
||||
'gr',
|
||||
'grs',
|
||||
'grams',
|
||||
'variety',
|
||||
'quality',
|
||||
};
|
||||
|
||||
/// Selects the variety name from Tesseract [hocr]: keep the words whose glyph
|
||||
|
|
@ -112,7 +127,13 @@ HocrLabel? readHocrLabel(String hocr, {int minConfidence = 20}) {
|
|||
final text = _unescape(m.group(6)!).trim();
|
||||
if (text.isEmpty) continue;
|
||||
words.add(
|
||||
_Word(x0: x0, y0: y0, height: y1 - y0, text: text, confidence: confidence),
|
||||
_Word(
|
||||
x0: x0,
|
||||
y0: y0,
|
||||
height: y1 - y0,
|
||||
text: text,
|
||||
confidence: confidence,
|
||||
),
|
||||
);
|
||||
}
|
||||
if (words.isEmpty) return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue