@@ -299,8 +299,8 @@ Text.find self pattern:(Regex | Text)=".*" case_sensitivity:Case_Sensitivity=..S
299
299
example_find_all_insensitive =
300
300
## This matches `aABbbbc` @ character 0 and `aBC` @ character 11
301
301
"aABbbbccccaaBCaaaa".find_all "a[ab]+c" Case_Sensitivity.Insensitive
302
- Text.find_all : Text -> Case_Sensitivity -> Vector Match ! Regex_Syntax_Error | Illegal_Argument
303
- Text.find_all self pattern:Text=".*" case_sensitivity:Case_Sensitivity=..Sensitive =
302
+ Text.find_all : Text|Regex -> Case_Sensitivity -> Vector Match ! Regex_Syntax_Error | Illegal_Argument
303
+ Text.find_all self pattern:Text|Regex =".*" case_sensitivity:Case_Sensitivity=..Sensitive =
304
304
case_insensitive = case_sensitivity.is_case_insensitive_in_memory
305
305
compiled_pattern = Regex.compile pattern case_insensitive=case_insensitive
306
306
compiled_pattern.match_all self
@@ -334,8 +334,8 @@ Text.find_all self pattern:Text=".*" case_sensitivity:Case_Sensitivity=..Sensiti
334
334
regex = ".+ct@.+"
335
335
# Evaluates to true
336
336
"
[email protected] ".match regex Case_Sensitivity.Insensitive
337
- Text.match : Text -> Case_Sensitivity -> Boolean ! Regex_Syntax_Error | Illegal_Argument
338
- Text.match self pattern:Text=".*" case_sensitivity:Case_Sensitivity=..Sensitive =
337
+ Text.match : Text|Regex -> Case_Sensitivity -> Boolean ! Regex_Syntax_Error | Illegal_Argument
338
+ Text.match self pattern:Text|Regex =".*" case_sensitivity:Case_Sensitivity=..Sensitive =
339
339
case_insensitive = case_sensitivity.is_case_insensitive_in_memory
340
340
compiled_pattern = Regex.compile pattern case_insensitive=case_insensitive
341
341
compiled_pattern.matches self
@@ -452,8 +452,8 @@ Text.split self delimiter="," case_sensitivity:Case_Sensitivity=..Sensitive use_
452
452
453
453
'Hello Big\r\nWide\tWorld\nGoodbye!' . tokenize "(\S+)(?:\s+|$)"
454
454
== ["Hello","Big","Wide","World","Goodbye!"]
455
- Text.tokenize : Text -> Case_Sensitivity -> Vector Text
456
- Text.tokenize self pattern:Text=(Missing_Argument.throw "pattern") case_sensitivity:Case_Sensitivity=..Sensitive =
455
+ Text.tokenize : Text|Regex -> Case_Sensitivity -> Vector Text
456
+ Text.tokenize self pattern:Text|Regex =(Missing_Argument.throw "pattern") case_sensitivity:Case_Sensitivity=..Sensitive =
457
457
case_insensitive = case_sensitivity.is_case_insensitive_in_memory
458
458
compiled_pattern = Regex.compile pattern case_insensitive=case_insensitive
459
459
compiled_pattern.tokenize self
@@ -614,7 +614,7 @@ Cleansable_Text.from (that:Text) = Cleansable_Text.Value (pattern->replace_with-
614
614
615
615
"แมวมีสี่ขา".words == ['แมว', 'มี', 'สี่', 'ขา']
616
616
Text.words : Boolean -> Vector Text
617
- Text.words self ( keep_whitespace : Boolean = False) =
617
+ Text.words self keep_whitespace: Boolean= False =
618
618
iterator = BreakIterator.getWordInstance
619
619
iterator.setText self
620
620
Vector.build builder->
@@ -657,7 +657,7 @@ Text.words self (keep_whitespace : Boolean = False) =
657
657
658
658
'\na\nb\n'.lines keep_endings=True == ['\n', 'a\n', 'b\n']
659
659
Text.lines : Boolean -> Vector Text
660
- Text.lines self ( keep_endings : Boolean = False) =
660
+ Text.lines self keep_endings: Boolean= False =
661
661
Vector.from_polyglot_array (Text_Utils.split_on_lines self keep_endings)
662
662
663
663
## GROUP Text
@@ -684,7 +684,7 @@ Text.lines self (keep_endings : Boolean = False) =
684
684
"Hello World!".insert 5 " Cruel" == "Hello Cruel World!"
685
685
"Hello World!".insert -1 " Cruel" == "Hello World! Cruel"
686
686
Text.insert : Integer -> Text -> Text ! Index_Out_Of_Bounds
687
- Text.insert self ( index : Integer) ( that : Text) =
687
+ Text.insert self index: Integer that: Text =
688
688
len = self.length
689
689
idx = if index < 0 then len + index + 1 else index
690
690
if (idx < 0) || (idx > len) then Error.throw (Index_Out_Of_Bounds.Error index len) else
@@ -718,7 +718,7 @@ Text.insert self (index : Integer) (that : Text) =
718
718
"A0".is_digit 1 == True
719
719
"건반(Korean)".is_digit 1 == False
720
720
Text.is_digit : Integer -> Boolean ! Index_Out_Of_Bounds
721
- Text.is_digit self ( index=0) =
721
+ Text.is_digit self index:Integer=0 =
722
722
grapheme = self.at index
723
723
char = (Text_Utils.get_chars grapheme).at 0
724
724
char>=48 && char<=57
@@ -1025,7 +1025,7 @@ Text.* self count:Integer = self.repeat count
1025
1025
1026
1026
"Hello ".repeat 2 == "Hello Hello "
1027
1027
Text.repeat : Integer -> Text
1028
- Text.repeat self ( count : Integer = 1) =
1028
+ Text.repeat self count: Integer=1 =
1029
1029
0.up_to count . fold "" acc-> _-> acc + self
1030
1030
1031
1031
## ALIAS first, head, keep, last, left, limit, mid, right, slice, substring, tail, top
0 commit comments