Skip to content

Commit 27ce319

Browse files
committed
tag change: ua_XXYY -> upYY
1 parent 43e9c37 commit 27ce319

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/main/groovy/ua/net/nlp/bruk/ContextToken.groovy

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import org.languagetool.rules.uk.LemmaHelper
1010
@Canonical
1111
class ContextToken {
1212
// static final Pattern POSTAG_KEY_PATTERN = Pattern.compile("^(noun:(anim|[iu]nanim)|verb(:rev)?:(perf|imperf)|adj|adv(p:(imperf:perf))?|part|prep|numr|conj:(coord|subord)|intj|onomat|punct|symb|noninfl|unclass|number|unknown|time|date|hashtag|BEG|END)")
13-
static final Pattern POSTAG_CORE_REMOVE_PATTERN = Pattern.compile(/:(arch|coll|slang|bad|vulg|ua_[0-9]{4}|ns)/)
13+
static final Pattern POSTAG_CORE_REMOVE_PATTERN = Pattern.compile(/:(arch|coll|slang|bad|vulg|up[0-9]{2}|ns)/)
1414
static final ContextToken BEG = new ContextToken('__BEG', '', 'BEG')
1515
static final ContextToken END = new ContextToken('__END', '', 'END')
1616
static final String[] IGNORE_TOKENS = [] //['б', 'би', 'ж', 'же', 'бодай']
@@ -135,11 +135,13 @@ class ContextToken {
135135
return w
136136
}
137137

138-
// його|що
139-
private static final USE_RIGHT_CTX_PATTERN = ~/є|її|це|саме|[ву]с[еі]|за|всередині|відповідно|перед|протягом|наприкінці|брати|(українськ|англійськ)(а|у|ою|ій)|рівні|доросл.*|майбутн(є|ього|ім|ому)|більше|добре/
140-
138+
// його|що
139+
private static final USE_RIGHT_CTX_PATTERN = ~(/є|її|це|саме|[ву]с[еі]|за/
140+
+ /|всередині|відповідно|перед|протягом|близько|навколо|довкола|наприкінці|неподалік|[ву]глиб|поза/
141+
+ /|брати|(українськ|англійськ)(а|у|ою|ій)|рівні|доросл.*|майбутн(є|ього|ім|ому)/
142+
+ /|більше|добре|геть|тільки/)
143+
141144
static boolean useRightContext(String token) {
142-
// token.toLowerCase() ==~ /це|його|її|їх|як|є|саме|все/
143145
token.toLowerCase() ==~ USE_RIGHT_CTX_PATTERN
144146
}
145147

src/main/groovy/ua/net/nlp/tools/tag/DisambigStats.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ public class DisambigStats {
369369
rate
370370
}
371371

372-
private static final Pattern POSTAG_NORM_PATTERN = ~ /:(xp[1-9]|ua_[0-9]{4}|comp.|&predic|&insert|vulg|coll|ns)/
372+
private static final Pattern POSTAG_NORM_PATTERN = ~ /:(xp[1-9]|up[0-9]{2}|comp.|&predic|&insert|vulg|coll|ns)/
373373

374374
@CompileStatic
375375
private static String normalizePostagForRate(String postag) {

src/main/groovy/ua/net/nlp/tools/tag/UdModule.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class UdModule {
159159
// try to guess gender for plural
160160
if( PLURAL_PATTERN.matcher(tkn.tags).find() ) {
161161

162-
if( tkn.lemma.startsWith("пів") && tkn.tags.contains("nv:ua_1992") )
162+
if( tkn.lemma.startsWith("пів") && tkn.tags.contains("nv:up92") )
163163
return
164164

165165
def newTag = tkn.tags.replace(':subst', '')

0 commit comments

Comments
 (0)