From 660cfe44c5e411d3763cb8bf683a7fdae14dba08 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Mon, 18 Feb 2019 13:26:22 +0100 Subject: [PATCH] Fix formatting --- website/docs/usage/rule-based-matching.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/website/docs/usage/rule-based-matching.md b/website/docs/usage/rule-based-matching.md index 43ff50b86..c4086d1ec 100644 --- a/website/docs/usage/rule-based-matching.md +++ b/website/docs/usage/rule-based-matching.md @@ -292,7 +292,7 @@ that they are listed as "User name: {username}". The name itself may contain any character, but no whitespace – so you'll know it will be handled as one token. ```python -[{'ORTH': 'User'}, {'ORTH': 'name'}, {'ORTH': ':'}, {}] +[{"ORTH": "User"}, {"ORTH": "name"}, {"ORTH": ":"}, {}] ``` ### Adding on_match rules {#on_match} @@ -301,9 +301,6 @@ To move on to a more realistic example, let's say you're working with a large corpus of blog articles, and you want to match all mentions of "Google I/O" (which spaCy tokenizes as `['Google', 'I', '/', 'O'`]). To be safe, you only match on the uppercase versions, in case someone has written it as "Google i/o". -You also add a second pattern with an added `{IS_DIGIT: True}` token – this will -make sure you also match on "Google I/O 2017". If your pattern matches, spaCy -should execute your custom callback function `add_event_ent`. ```python ### {executable="true"}