Wrong will be right,
when Aslan comes in sight,
At the sound of his roar,
sorrows will be no more,
When he bares his teeth,
winter meets its death,
And when he shakes his mane,
we shall have spring again.
Here is another style of chunk expression to be evaluated, along with its KreativeKorp re-interpretation:
word 3 of line 3 of text
And this is the result of the KreativeKorp library call:
Some more to try:
chunk = " "+ chunk
chunk = p:phrasechain _ s:chunk -> "jsChunkEx.getChunk(" s "," p ")"
chunk = "the"? _ "number" _ ("of"/"in") _ t:(t:type "s" [blue] -> t) _ "in" _ p:(p:phrasechain -> p ",")? _ s:chunk -> "jsChunkEx.countChunks(" s "," p t ")"
chunk = ("delete" [blue]) _ p:phrasechain _ s:chunk -> "jsChunkEx.deleteChunk(" s "," p ")"
chunk = ("put" [blue]) _ q:quoted _ ("after" [blue]) _ p:(p:phrasechain -> "," p )? _? s:chunk -> "jsChunkEx.appendToChunk(" s p "," q ")"
chunk = ("put" [blue]) _ q:quoted _ ("before" [blue]) _ p:(p:phrasechain -> "," p )? _? s:chunk -> "jsChunkEx.prependToChunk(" s p "," q ")"
chunk = ("put" [blue]) _ q:quoted _ ("into" [blue]) _ p:(p:phrasechain -> "," p )? _? s:chunk -> "jsChunkEx.replaceChunk(" s p "," q ")"
chunk = "text" [blue] -> "Events.Get('#text','value')"
chunk = quoted [green]
# in kk, line 3 to 4 of -> jsChunkEx.LINE,3,4
phrase = t:(type [blue]) _ n:number _ n2:("to" _ n2:number -> "," n2)? _ ("of"/"in") -> t "," n n2
phrase = "the"? _ n:ordinal _ n2:("to" _ n2:ordinal -> "," n2)? _ t:(type [blue]) _ ("of"/"in") -> t "," n n2
# but kk likes the parameters in reverse
phrasechain = left:phrase _ right:(p:phrasechain -> p ",")? -> right left
type = "character"/"char" -> "jsChunkEx.CHARACTER"
type = "word" -> "jsChunkEx.WORD"
type = "item" -> "jsChunkEx.ITEM"
type = "line" -> "jsChunkEx.LINE"
type = "sentence" -> "jsChunkEx.SENTENCE"
type = "paragraph" -> "jsChunkEx.PARAGRAPH"
type = "column" -> "jsChunkEx.COLUMN"
type = "row" -> "jsChunkEx.ROW"
number = ."0123456789"+
number = "(" (chunk/number) ")"
number = ordinal
number = q:quoted -> "jsChunkEx.BY_CONTENT," q
ordinal = "first" -> "jsChunkEx.FIRST"
ordinal = "middle" -> "jsChunkEx.MIDDLE"
ordinal = "last" -> "jsChunkEx.LAST"
ordinal = "any" -> "jsChunkEx.ANY"
quote = ."\"\“\”\‘\’\'"
quoted = quote q:(-quote .)* quote -> "\"" q "\""
_ = ." \t"*