You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: regex-imatriculation/regex-imatriculation.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Identify Licence Plates with the RegexExtractor
2
+
title: Identify License Plates with the RegexExtractor
3
3
duration:
4
4
---
5
5
@@ -14,33 +14,33 @@ duration: 3
14
14
Botfuel natively supports 31 built-in entities such as `forename`, `location`, `duration` and `url`. You can also create your own dictionary of custom entities using the <ahref="https://docs.botfuel.io/dialog/reference/entities/custom-entities"target="_blank">CorpusExtractor</a> class.
15
15
However, you may want to use an extractor based on regular expression.
16
16
17
-
In this tutorial, you will learn how to create an extractor for French licence plates using a RegexExtractor.
17
+
In this tutorial, you will learn how to create an extractor for French license plates using a RegexExtractor.
18
18
19
19
## You will need
20
20
* To have complet the <ahref="/#/codelab/getting-started"target="_blank">Getting Started tutorial</a>
21
21
* A very basic understanding of Regular expressions (but don't panic, we said very basic!)
22
22
23
23
--sep--
24
24
---
25
-
title: The French licence plate system
25
+
title: The French license plate system
26
26
duration: 4
27
27
---
28
28
29
-
# The French licence plate system
29
+
# The French license plate system
30
30
31
31
The French license plate system (known as SIV for système d’immatriculation des véhicules) is used by all cars registered since 2009.
<b>Note:</b> Under the SIV system, licence plates contain seven alphanumeric characters: two letters, a dash, three numbers, a dash and two letters, such as AA-229-AA. The system is nationwide and chronological. The first car registered in France under the SIV received a AA-001-AA licence plate, the second one AA-002-AA, the third AA-003-AA. The system will be exhausted when ZZ-999-ZZ is reached, which is scheduled to occur after 80 years of use.
38
+
<b>Note:</b> Under the SIV system, license plates contain seven alphanumeric characters: two letters, a dash, three numbers, a dash and two letters, such as AA-229-AA. The system is nationwide and chronological. The first car registered in France under the SIV received a AA-001-AA license plate, the second one AA-002-AA, the third AA-003-AA. The system will be exhausted when ZZ-999-ZZ is reached, which is scheduled to occur after 80 years of use.
39
39
40
40
You can find more information on <ahref="https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_France#SIV"target="_blank">Wikipedia</a>
41
41
</aside>
42
42
43
-
The SIV system makes is very easy to identify if a given string is a valid licence plate. However, as mentioned in wikipedia `The SIV format provides ((23 x 23) - 2) x 999 x ((23 x 23) - 1), or 277,977,744 different combinations`. Therefore, we don't recommend you build a corpus of entities with every possible combination...
43
+
The SIV system makes is very easy to identify if a given string is a valid license plate. However, as mentioned in wikipedia `The SIV format provides ((23 x 23) - 2) x 999 x ((23 x 23) - 1), or 277,977,744 different combinations`. Therefore, we don't recommend you build a corpus of entities with every possible combination...
44
44
45
45
--sep--
46
46
---
@@ -60,14 +60,14 @@ We mentioned in the introduction that you would need a basic understanding of re
Our licence plate can be separated into 5 sections :
64
-
1.`AA`: Here, we use `[A-Za-z]{2}` to match any combination of two letters between range `A-Z` or `a-z` as we don't want our extractor to be case sensitive. We want to extract the licence plate even if the user sends us one in lowercase.
63
+
Our license plate can be separated into 5 sections :
64
+
1.`AA`: Here, we use `[A-Za-z]{2}` to match any combination of two letters between range `A-Z` or `a-z` as we don't want our extractor to be case sensitive. We want to extract the license plate even if the user sends us one in lowercase.
65
65
2.`-`: A literal dash character.
66
66
3.`999`: We use `[0-9]{2,3}` as we want to match any combination of 2 or 3 digits. (Scooters use 2 letters).
67
67
4.`-`: Another literal dash character.
68
68
5.`AA`: The last section is the same as the first one.
69
69
70
-
Once we have our regular expression to extract a licence plate, we can use is in our extractor
70
+
Once we have our regular expression to extract a license plate, we can use is in our extractor
71
71
72
72
## Use it in the RegexExtractor
73
73
@@ -106,7 +106,7 @@ Got to <a href="https://app.botfuel.io" target="_blank">https://app.botfuel.io</
106
106
<imgsrc="https://github.com/Botfuel/tutorials/raw/master/regex-imatriculation/images/trainer.png"alt="intent in trainer"title="Intent in trainer"/>
107
107
</center>
108
108
109
-
Add a few training phrases the user may enter to give you his licence plate.
109
+
Add a few training phrases the user may enter to give you his license plate.
110
110
111
111
## Create the Dialog
112
112
@@ -146,11 +146,11 @@ class LicensePlateView extends PromptView {
146
146
147
147
if (licensePlate) {
148
148
return [
149
-
newBotTextMessage(`Thanks, your licence plate is ${licensePlate.toUpperCase()}.`),
149
+
newBotTextMessage(`Thanks, your license plate is ${licensePlate.toUpperCase()}.`),
150
150
];
151
151
}
152
152
153
-
return [newBotTextMessage(`Sorry, I did not understand your licence plate.`)];
153
+
return [newBotTextMessage(`Sorry, I did not understand your license plate.`)];
0 commit comments