463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
|
// returns a list of sWord's stems
if (!sWord) {
return [];
}
if (!_dAnalyses.has(sWord) && !_storeMorphFromFSA(sWord)) {
return [];
}
return [ for (s of _dAnalyses.get(sWord)) s.slice(1, s.indexOf(" ")) ];
}
//// functions to get text outside pattern scope
// warning: check compile_rules.py to understand how it works
|
|
|
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
|
// returns a list of sWord's stems
if (!sWord) {
return [];
}
if (!_dAnalyses.has(sWord) && !_storeMorphFromFSA(sWord)) {
return [];
}
return _dAnalyses.get(sWord).map( s => s.slice(1, s.indexOf(" ")) );
}
//// functions to get text outside pattern scope
// warning: check compile_rules.py to understand how it works
|
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
|
if (!_dAnalyses.has(sWord) && !_storeMorphFromFSA(sWord)) {
return true;
}
//echo("morph: "+_dAnalyses.get(sWord).toString());
if (_dAnalyses.get(sWord).length === 1) {
return true;
}
let lSelect = [ for (sMorph of _dAnalyses.get(sWord)) if (sMorph.search(sPattern) !== -1) sMorph ];
//echo("lSelect: "+lSelect.toString());
if (lSelect.length > 0) {
if (lSelect.length != _dAnalyses.get(sWord).length) {
dDA.set(nPos, lSelect);
}
} else if (lDefault) {
dDA.set(nPos, lDefaul);
|
|
|
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
|
if (!_dAnalyses.has(sWord) && !_storeMorphFromFSA(sWord)) {
return true;
}
//echo("morph: "+_dAnalyses.get(sWord).toString());
if (_dAnalyses.get(sWord).length === 1) {
return true;
}
let lSelect = _dAnalyses.get(sWord).filter( sMorph => sMorph.search(sPattern) === -1 );
//echo("lSelect: "+lSelect.toString());
if (lSelect.length > 0) {
if (lSelect.length != _dAnalyses.get(sWord).length) {
dDA.set(nPos, lSelect);
}
} else if (lDefault) {
dDA.set(nPos, lDefaul);
|
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
|
}
if (!_dAnalyses.has(sWord) && !_storeMorphFromFSA(sWord)) {
return true;
}
if (_dAnalyses.get(sWord).length === 1) {
return true;
}
let lSelect = [ for (sMorph of _dAnalyses.get(sWord)) if (sMorph.search(sPattern) === -1) sMorph ];
//echo("lSelect: "+lSelect.toString());
if (lSelect.length > 0) {
if (lSelect.length != _dAnalyses.get(sWord).length) {
dDA.set(nPos, lSelect);
}
} else if (lDefault) {
dDA.set(nPos, lDefault);
|
|
|
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
|
}
if (!_dAnalyses.has(sWord) && !_storeMorphFromFSA(sWord)) {
return true;
}
if (_dAnalyses.get(sWord).length === 1) {
return true;
}
let lSelect = _dAnalyses.get(sWord).filter( sMorph => sMorph.search(sPattern) === -1 );
//echo("lSelect: "+lSelect.toString());
if (lSelect.length > 0) {
if (lSelect.length != _dAnalyses.get(sWord).length) {
dDA.set(nPos, lSelect);
}
} else if (lDefault) {
dDA.set(nPos, lDefault);
|