mirror of
https://github.com/explosion/spaCy.git
synced 2025-06-30 09:53:04 +03:00
Fix pronoun handling
Missed this case earlier. 連体詞 have three classes for UD purposes: - その -> DET - それ -> PRON - 同じ -> ADJ -POLM
This commit is contained in:
parent
c435f748d7
commit
53e17296e9
|
@ -51,9 +51,10 @@ def resolve_pos(token):
|
||||||
# PoS mappings.
|
# PoS mappings.
|
||||||
|
|
||||||
if token.part_of_speech == '連体詞,*,*,*':
|
if token.part_of_speech == '連体詞,*,*,*':
|
||||||
# determiner-likes get DET, otherwise ADJ
|
|
||||||
if re.match('^[こそあど此其彼]の', token.surface):
|
if re.match('^[こそあど此其彼]の', token.surface):
|
||||||
return token.part_of_speech + ',DET'
|
return token.part_of_speech + ',DET'
|
||||||
|
if re.match('^[こそあど此其彼]', token.surface):
|
||||||
|
return token.part_of_speech + ',PRON'
|
||||||
else:
|
else:
|
||||||
return token.part_of_speech + ',ADJ'
|
return token.part_of_speech + ',ADJ'
|
||||||
return token.part_of_speech
|
return token.part_of_speech
|
||||||
|
|
Loading…
Reference in New Issue
Block a user