From 176fc9055991f71be749f7ca54959254da5eca90 Mon Sep 17 00:00:00 2001 From: Yang Zhao Date: Thu, 13 Nov 2014 18:27:34 -0800 Subject: [PATCH] add middle dot --- lib/TwitterText.m | 11 +++++++++++ test/json-conformance/extract.json | 7 +++++++ test/twitter-text-conformance | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/TwitterText.m b/lib/TwitterText.m index baca305..4f8867a 100644 --- a/lib/TwitterText.m +++ b/lib/TwitterText.m @@ -53,6 +53,16 @@ // // Hashtag // +#define TWUMiddleDot @"\\u00B7" +#define TWUBullet @"\\u2022" +#define TWUKatakanaMiddleDot @"\\u30FB" +#define TWUHalfwidthKatakanaMiddleDot @"\\uff65" + +#define TWUSpecialCharsIncluded \ + TWUMiddleDot \ + TWUBullet \ + TWUKatakanaMiddleDot \ + TWUHalfwidthKatakanaMiddleDot #define TWUCyrillicHashtagChars @"\\u0400-\\u04FF" #define TWUCyrillicSupplementHashtagChars @"\\u0500-\\u0527" @@ -137,6 +147,7 @@ TWULatinAccents \ TWUNonLatinHashtagChars \ TWUCJKHashtagCharacters \ + TWUSpecialCharsIncluded \ @"]" #define TWUHashtagBoundaryInvalidChars \ diff --git a/test/json-conformance/extract.json b/test/json-conformance/extract.json index d90394b..4df0b30 100644 --- a/test/json-conformance/extract.json +++ b/test/json-conformance/extract.json @@ -1167,6 +1167,13 @@ } ], "hashtags": [ + { + "description": "Extract mid-dot hashtag", + "text": "a #ビ·ル•ゲ・イ・ツ", + "expected": [ + "ビ·ル•ゲ・イ・ツ" + ] + }, { "description": "Extract an all-alpha hashtag", "text": "a #hashtag here", diff --git a/test/twitter-text-conformance b/test/twitter-text-conformance index be88d01..34b2fd8 160000 --- a/test/twitter-text-conformance +++ b/test/twitter-text-conformance @@ -1 +1 @@ -Subproject commit be88d01a567c82bc625f8991cd825dc100e01321 +Subproject commit 34b2fd833cca52aedcf08e03fa60c4210facfd32