File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ class RegexFilter implements Transformer
59
59
*
60
60
* @var literal-string
61
61
*/
62
- public const EXTRA_CHARACTERS = '/([^\w\s])(?=[^\w\s]*\1)/ ' ;
62
+ public const EXTRA_CHARACTERS = '/([^\w\s])(?=[^\w\s]*\1)/u ' ;
63
63
64
64
/**
65
65
* Matches consecutively repeated words.
@@ -73,7 +73,7 @@ class RegexFilter implements Transformer
73
73
*
74
74
* @var literal-string
75
75
*/
76
- public const EXTRA_WHITESPACE = '/\s(?=\s+)/ ' ;
76
+ public const EXTRA_WHITESPACE = '/\s(?=\s+)/u ' ;
77
77
78
78
/**
79
79
* A pattern to match unicode emojis.
@@ -87,14 +87,14 @@ class RegexFilter implements Transformer
87
87
*
88
88
* @var literal-string
89
89
*/
90
- public const MENTION = '/(@\w+)/ ' ;
90
+ public const MENTION = '/(@\w+)/u ' ;
91
91
92
92
/**
93
93
* A pattern to match Twitter-style hashtags (ex. #MachineLearning).
94
94
*
95
95
* @var literal-string
96
96
*/
97
- public const HASHTAG = '/(#\w+)/ ' ;
97
+ public const HASHTAG = '/(#\w+)/u ' ;
98
98
99
99
/**
100
100
* A list of regular expression patterns used to filter the text columns of the dataset.
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ protected function setUp() : void
33
33
[
'Too weird to live, [email protected] too rare to die https://rubixml.com ' ],
34
34
['A man who procrastinates in @his choosing will inevitably have his choice made for him by #circumstance ' ],
35
35
['The quick quick brown fox jumped over the lazy man sitting at a bus stop drinking a can of Cola cola ' ],
36
- ['Diese äpfel Äpfel schmecken sehr gut ' ],
36
+ ['Diese₂ äpfel Äpfel schmecken sehr gut ' ],
37
37
]);
38
38
39
39
$ this ->transformer = new RegexFilter ([
@@ -68,7 +68,7 @@ public function transform() : void
68
68
['Too weird to live, too rare to die ' ],
69
69
['A man who procrastinates in choosing will inevitably have his choice made for him by ' ],
70
70
['The quick brown fox jumped over the lazy man sitting at a bus stop drinking a can of cola ' ],
71
- ['Diese Äpfel schmecken sehr gut ' ],
71
+ ['Diese₂ Äpfel schmecken sehr gut ' ],
72
72
];
73
73
74
74
$ this ->assertEquals ($ expected , $ this ->dataset ->samples ());
You can’t perform that action at this time.
0 commit comments