improve iterate parameter
This commit is contained in:
@@ -153,11 +153,15 @@ keyword parameter type:
|
||||
match: mills?
|
||||
keyword parameter type:
|
||||
name: iterate
|
||||
match: [., ](t?w?i?c?e?|t?h?r?e?e?|f?o?u?r?|f?i?v?e?|s?i?x?|s?e?v?e?n?|X?)?( ?t?i?m?e?s?)?
|
||||
match: [., ](o?n?c?e?|o?n?e?|t?w?i?c?e?|t?w?o?|t?h?r?e?e?|f?o?u?r?|f?i?v?e?|s?i?x?|s?e?v?e?n?|X?)?( ?t?i?m?e?s?)?
|
||||
refer script:
|
||||
name: as words
|
||||
description: Use the iteration word (twice, three times, etc)
|
||||
script: \{iterate_fix({input})\}
|
||||
name: as words, use "" for blank
|
||||
description: Use the iteration word (twice, three, etc)
|
||||
script: \{iterate_string({input})\}
|
||||
refer script:
|
||||
name: as words, use "one" for blank
|
||||
description: Use the iteration word (twice, three, etc)
|
||||
script: \{iterate_string({input}, empty:"one")\}
|
||||
refer script:
|
||||
name: as number
|
||||
description: Use the iteration word (twice, three times, etc)
|
||||
|
||||
@@ -1068,7 +1068,13 @@ iterate_fix := remove_tags
|
||||
+replace@(match: "^\\.", replace:"")
|
||||
+replace@(match: "^,", replace:"")
|
||||
+replace@(match: "^[ ]", replace:"")
|
||||
+replace@(match:" times", replace:"")
|
||||
+replace@(match:" ti?m?e?s?$", replace:"")
|
||||
iterate_string := {
|
||||
str := iterate_fix(input)
|
||||
if str == ""
|
||||
then empty_lead + empty + empty_follow
|
||||
else non_empty_lead + str + non_empty_follow
|
||||
}@(non_empty_lead:" ", non_empty_follow:"", empty_lead:"", empty_follow:"", empty:"")
|
||||
digital_map := [
|
||||
"zero": 0,
|
||||
"one": 1,
|
||||
|
||||
Reference in New Issue
Block a user