Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: awilliams1024If you have a reference list of valid words then you could use the X-Ref node to match the valid words in your data and tag them as correct (or incorrect). This example uses case insensitive matching.
Copy and paste the example code into the BRE canvas:
node:Static_Data
bretype:core::Static Data
editor:sortkey=5788c0ad2a22466e
output:@40fe6c55598828e5/=
prop:StaticData=<<EOX
data:string
ACADEMY
ACDEMY
ACADEMYy
EOX
editor:XY=220,110
end:Static_Data
node:XRef
bretype:core::X-Ref
editor:sortkey=5788c1186674751a
input:@45781ca80c2802d0/=Static_Data.40fe6c55598828e5
input:@45781ca971fe502f/=Words_List.40fe6c55598828e5
editor:bend=1=300|210
editor:bend=1=300|120
output:@45781cad02e051b0/=
output:@457826825d7c2de0/=
output:@4578268450ad5d88/=
prop:LeftInputKey=<<EOX
toUpper(data)
EOX
prop:RightInputKey=<<EOX
toUpper(Words)
EOX
prop:Script=<<EOX
output 1 {
emit 1:*, false as "Correct"
where join.leftOrphan
}
output 2 {
emit *, true as "Correct"
exclude referencedFields(2,{{^RightInputKey^}})
where join.match
}
output 3 {
emit 2:*
where join.rightOrphan
}
EOX
prop:SortLeftInput=true
prop:SortRightInput=true
editor:XY=390,110
node:Sort_2
bretype:::Sort
editor:shadow=45782670131b71e8
input:@40fd2c743ebf4304/=
output:@40fd2c746a2a3b47/=
end:Sort_2
node:Bypass_3
bretype:::Bypass
editor:shadow=4578267017753cec
input:@45782010749f0c96/=
input:@457820124fef7658/=
output:@40fd2c7436717256/=
end:Bypass_3
node:Join
bretype:::Join
editor:shadow=457826701862249e
input:@40fd2c745b6d7704/=
input:@40fd2c74504921cd/=
output:@40fd2c7430f76546/=
output:@457826cc03a465f4/=
output:@457826cc510c69e0/=
end:Join
node:Bypass
bretype:::Bypass
editor:shadow=4578267041681261
input:@45782010749f0c96/=
input:@457820124fef7658/=
output:@40fd2c7436717256/=
end:Bypass
node:Sort
bretype:::Sort
editor:shadow=4578267075a60d09
input:@40fd2c743ebf4304/=
output:@40fd2c746a2a3b47/=
end:Sort
end:XRef
node:Words_List
bretype:core::Static Data
editor:Label=Words List
editor:sortkey=5788c0637bf075dd
output:@40fe6c55598828e5/=
prop:StaticData=<<EOX
Words:string
a
able
about
academy
account
acid
across
act
addition
adjustment
EOX
editor:XY=220,210
end:Words_List
node:Cat
bretype:core::Cat
editor:sortkey=5788c51c618e671e
input:@40fd2c7476b11c42/=XRef.45781cad02e051b0
input:5788c52170650899/matches=XRef.457826825d7c2de0
output:@40fd2c74676e03c3/=
editor:XY=520,100
end:Cat
You may also want to search on the Forum for 'Fuzzy' matching if you are interested in looking for words with spelling mistakes, e.g.
http://community.lavastorm.com/threa...-match-example
Regards,
Adrian