LVG Trie Wild Card

I. What is a Wild Card?

Input suffix (key) and output suffix (value) in a rule are used as pattern for matching and changing the input term. Lowercase characters are matched as literals. Some uppercase letters are defined as below and used as wild cards. Other uppercase letters should not be used.

II. Types of Wild Cards

  • C: any consonant [b,c,d,f,g,h,j,k,l,m,n,p,q,r,s,t,v,w,x,y,z]
  • D: digit [0-9]
  • L: any letter [a-z]
  • S: same character as the following character in the string.
  • V: any vowel [a,e,i,o,u]
  • ^: start
  • $: end

III. Examples

< Ex > $ means any string, such as:

  • test (true)
  • alike (true)

< Ex > Cy$ means any string with suffix as "consonant + y"

  • likely (true)
  • say (false: a is not a consonant)

< Ex > D$ means any string with suffix as "digit"

  • likely (false: y is not a digit)
  • commerce-1 (true)

< Ex > ^L$ means any string is length of 2 and with suffix as "letter"

  • likely (false: too long)
  • by (true)
  • b2 (false: 2 is not a letter)

< Ex > CVC$ means any string with suffix as "consonant + vowel + consonant"

  • button (true)

< Ex > CVSCing$ means any string with suffix as "consonant + vowel + consonant (must be same as the next) + consonant + i + n + g"

  • boxxing (true)
  • selecting (false: c is different from t)