nl_tokens: Apply a rule .
pl_tokens: function apply ( value , rule , rules ) { var entries = rule . entries var words = [ ] var index = - 1 var length = entries . length var entry var next var continuationRule var continuation var position var count while ( ++ index < length ) { entry = entries [ index ] if ( ! entry . match || value . match ( entry . match ) ) { next = value if ( entry . remove ) { next = next . <mask> ( entry . remove , '' ) } if ( rule . type === 'SFX' ) { next += entry . add } else { next = entry . add + next } words . push ( next ) continuation = entry . continuation if ( continuation && continuation . length !== 0 ) { position = - 1 count = continuation . length while ( ++ position < count ) { continuationRule = rules [ continuation [ position ] ] if ( continuationRule ) { words = words . concat ( apply ( next , continuationRule , rules ) ) } } } } } return words }