Remove UPPER from Matcher attributes docs (resolves #1949)

This commit is contained in:
ines 2018-02-08 11:29:27 +01:00
parent 696ae87b47
commit a3b965b29d
2 changed files with 5 additions and 5 deletions

View File

@ -88,8 +88,8 @@ p
+cell The exact verbatim text of a token. +cell The exact verbatim text of a token.
+row +row
+cell.u-nowrap #[code LOWER], #[code UPPER] +cell.u-nowrap #[code LOWER]
+cell The lowercase, uppercase form of the token text. +cell The lowercase form of the token text.
+row +row
+cell.u-nowrap #[code IS_ALPHA], #[code IS_ASCII], #[code IS_DIGIT] +cell.u-nowrap #[code IS_ALPHA], #[code IS_ASCII], #[code IS_DIGIT]
@ -222,8 +222,8 @@ p
doc.ents += ((EVENT, start, end),) doc.ents += ((EVENT, start, end),)
matcher.add('GoogleIO', add_event_ent, matcher.add('GoogleIO', add_event_ent,
[{'ORTH': 'Google'}, {'UPPER': 'I'}, {'ORTH': '/'}, {'UPPER': 'O'}], [{'ORTH': 'Google'}, {'ORTH': 'I'}, {'ORTH': '/'}, {'ORTH': 'O'}],
[{'ORTH': 'Google'}, {'UPPER': 'I'}, {'ORTH': '/'}, {'UPPER': 'O'}, {'IS_DIGIT': True}]) [{'ORTH': 'Google'}, {'ORTH': 'I'}, {'ORTH': '/'}, {'ORTH': 'O'}, {'IS_DIGIT': True}])
p p
| In addition to mentions of "Google I/O", your data also contains some | In addition to mentions of "Google I/O", your data also contains some

View File

@ -231,7 +231,7 @@ p
def set_sentiment(matcher, doc, i, matches): def set_sentiment(matcher, doc, i, matches):
doc.sentiment += 0.1 doc.sentiment += 0.1
pattern1 = [{'ORTH': 'Google'}, {'UPPER': 'I'}, {'ORTH': '/'}, {'UPPER': 'O'}] pattern1 = [{'ORTH': 'Google'}, {'ORTH': 'I'}, {'ORTH': '/'}, {'ORTH': 'O'}]
pattern2 = [[{'ORTH': emoji, 'OP': '+'}] for emoji in ['😀', '😂', '🤣', '😍']] pattern2 = [[{'ORTH': emoji, 'OP': '+'}] for emoji in ['😀', '😂', '🤣', '😍']]
matcher.add('GoogleIO', None, pattern1) # match "Google I/O" or "Google i/o" matcher.add('GoogleIO', None, pattern1) # match "Google I/O" or "Google i/o"
matcher.add('HAPPY', set_sentiment, *pattern2) # match one or more happy emoji matcher.add('HAPPY', set_sentiment, *pattern2) # match one or more happy emoji