I have 2 routines that should be completely parallel. I want Snowball to execute them and choose the one with the longest match.
Currently, I run them using or
. That means execute the first, if fails execute the second.
I thought of perform a test for both routines get the length of match, store it in variables, then compare them and execute the routine with the longest match.
Is there a standard instruction to do it or a better solution?
pseudo code:
Verb_Suffixes
or
Noun_Suffixes
real code
//Suffixes for verbs
(
is_verb
(
(
(atleast 1 Suffix_Verb_Step1)
( Suffix_Verb_Step2a or Suffix_Verb_Step2c or next)
)
or Suffix_Verb_Step2b
or Suffix_Verb_Step2a
)
)
//Suffixes for nouns
or (
is_noun
(
try (
Suffix_Noun_Step2c2
or (not is_defined Suffix_Noun_Step1a (
Suffix_Noun_Step2a
or Suffix_Noun_Step2b
or Suffix_Noun_Step2c1
or next))
or (Suffix_Noun_Step1b (
Suffix_Noun_Step2a
or Suffix_Noun_Step2b
or Suffix_Noun_Step2c1))
or (not is_defined Suffix_Noun_Step2a)
or (Suffix_Noun_Step2b)
)
Suffix_Noun_Step3
)
)