I'm working on a program that deals with 'part-of-speech tagged' strings such as "I_Pronoun am_Verb a_Determiner human_Noun"
. What I want to do is replace each verb with Verb+number of syllables of the word, which I can accomplish with this:
StringReplace["Our_Pronoun journey_Noun had_Verb advanced_Verb", {" "~~
x___ ~~ "_Verb" .. :> " Verb"<>syllables[x]}]
This works great (it doesn't match verbs at the beginning of the sentence, but surprisingly this is also what I want). Now, I want to make it so it matches all verbs except specific ones. So if I have a list like verbBlacklist={"had","were"}
and modify the above code such that everything is the same but 'had' and 'were' are no longer matched.
I have no idea how to do this with string patterns. I've seen Except
for characters, is there an equivalent for words?