Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

add middle dot in hashtag #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/TwitterText.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -137,6 +147,7 @@
TWULatinAccents \
TWUNonLatinHashtagChars \
TWUCJKHashtagCharacters \
TWUSpecialCharsIncluded \
@"]"

#define TWUHashtagBoundaryInvalidChars \
Expand Down
7 changes: 7 additions & 0 deletions test/json-conformance/extract.json
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,13 @@
}
],
"hashtags": [
{
"description": "Extract mid-dot hashtag",
"text": "a #ビ·ル•ゲ・イ・ツ",
"expected": [
"ビ·ル•ゲ・イ・ツ"
]
},
{
"description": "Extract an all-alpha hashtag",
"text": "a #hashtag here",
Expand Down
2 changes: 1 addition & 1 deletion test/twitter-text-conformance