[AF] regexes for hinidi
based on www.nvsp.in
Also, correcting small mistake for price regex.
Change-Id: I864f4d4a28311ef76cf4411107777a248c8e17cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1661095
Reviewed-by: Roger McFarlane <rogerm@chromium.org>
Commit-Queue: Parastoo Geranmayeh <parastoog@google.com>
Cr-Commit-Position: refs/heads/master@{#669747}
diff --git a/components/autofill/core/common/autofill_regex_constants.cc b/components/autofill/core/common/autofill_regex_constants.cc
index 7443330..6af11a1 100644
--- a/components/autofill/core/common/autofill_regex_constants.cc
+++ b/components/autofill/core/common/autofill_regex_constants.cc
@@ -96,6 +96,7 @@
"|郵便番号" // ja-JP
"|codigo|codpos|\\bcep\\b" // pt-BR, pt-PT
"|Почтовый.?Индекс" // ru
+ "|पिन.?कोड" // hi
"|邮政编码|邮编" // zh-CN
"|郵遞區號" // zh-TW
"|우편.?번호"; // ko-KR
@@ -115,6 +116,8 @@
"|市" // zh-CN
"|分區" // zh-TW
"|شهر" // fa
+ "|शहर" // hi for city
+ "|ग्राम|गाँव" // hi for village
"|^시[^도·・]|시[·・]?군[·・]?구"; // ko-KR
const char kStateRe[] =
"(?<!(united|hist|history).?)state|county|region|province"
@@ -125,6 +128,7 @@
"|省" // zh-CN
"|地區" // zh-TW
"|استان" // fa
+ "|राज्य" // hi
"|^시[·・]?도"; // ko-KR
/////////////////////////////////////////////////////////////////////////////
@@ -148,8 +152,8 @@
/////////////////////////////////////////////////////////////////////////////
const char kPriceRe[] =
"\\bprice\\b|\\brate\\b|\\bcost\\b"
- "قیمة|سعر" // ar
- "قیمت" // fa
+ "|قیمة|سعر" // ar
+ "|قیمت" // fa
"|\\bprix\\b|\\bcoût\\b|\\bcout\\b|\\btarif\\b"; // fr-CA
/////////////////////////////////////////////////////////////////////////////
@@ -258,6 +262,7 @@
"|邮件|邮箱" // zh-CN
"|電郵地址" // zh-TW
"|ایمیل|پست.*الکترونیک" // fa
+ "|ईमेल|इलॅक्ट्रॉनिक.?मेल" // hi
"|(?:이메일|전자.?우편|[Ee]-?mail)(.?주소)?"; // ko-KR
/////////////////////////////////////////////////////////////////////////////
@@ -291,7 +296,8 @@
"|nome" // pt-BR, pt-PT
"|Имя" // ru
"|نام" // fa
- "|이름"; // ko-KR
+ "|이름" // ko-KR
+ "|^नाम"; // hi
const char kMiddleInitialRe[] = "middle.*initial|m\\.i\\.|mi$|\\bmi\\b";
const char kMiddleNameRe[] =
"middle.*name|mname|middle$"
@@ -310,6 +316,7 @@
"|morada|apelidos|surename|sobrenome" // pt-BR, pt-PT
"|Фамилия" // ru
"|نام.*خانوادگی" // fa
+ "|उपनाम" // hi
"|\\b성(?:[^명]|\\b)"; // ko-KR
/////////////////////////////////////////////////////////////////////////////
@@ -323,6 +330,7 @@
"|電話" // ja-JP
"|telefone|telemovel" // pt-BR, pt-PT
"|телефон" // ru
+ "|मोबाइल" // hi for mobile
"|电话" // zh-CN
"|(?:전화|핸드폰|휴대폰|휴대전화)(?:.?번호)?"; // ko-KR
const char kCountryCodeRe[] =
diff --git a/components/test/data/autofill/heuristics/input/157_i18n_hi.html b/components/test/data/autofill/heuristics/input/157_i18n_hi.html
new file mode 100644
index 0000000..b1be9a6
--- /dev/null
+++ b/components/test/data/autofill/heuristics/input/157_i18n_hi.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title></title>
+ </head>
+ <body>
+ <form action="http://www.google.com/" method="post">
+ <label for="fn">नाम:</label> <input type="text" id="fn"><br>
+ <label for="ln">उपनाम:</label> <input type="text" id="ln"><br>
+ <label for="ct">शहर:</label> <input type="text" id="ct"><br>
+ <label for="st">राज्य:</label> <input type="text" id="st"><br>
+ <label for="zc">पिन कोड:</label> <input type="text" id="zc"><br>
+ <label for="em">ईमेल:</label> <input type="text" id="em"><br>
+ <label for="ph">मोबाइल:</label> <input type="text" id="ph"><br>
+ </form>
+ </body>
+</html>
diff --git a/components/test/data/autofill/heuristics/output/157_i18n_hi.out b/components/test/data/autofill/heuristics/output/157_i18n_hi.out
new file mode 100644
index 0000000..3aa91ac
--- /dev/null
+++ b/components/test/data/autofill/heuristics/output/157_i18n_hi.out
@@ -0,0 +1,7 @@
+NAME_FIRST | fn | नाम: | | fn_1-default
+NAME_LAST | ln | उपनाम: | | fn_1-default
+ADDRESS_HOME_CITY | ct | शहर: | | fn_1-default
+ADDRESS_HOME_STATE | st | राज्य: | | fn_1-default
+ADDRESS_HOME_ZIP | zc | पिन कोड: | | fn_1-default
+EMAIL_ADDRESS | em | ईमेल: | | fn_1-default
+PHONE_HOME_WHOLE_NUMBER | ph | मोबाइल: | | fn_1-default