graphtransliterator-ts / costOf
Function: costOf()
costOf(
prevClasses,prevTokens,tokens,nextTokens,nextClasses):number
Defined in: Rules.ts:104
Calculate cost of a rule.
Rules with more total constraints (prev/next classes/tokens + matched tokens) have lower cost and should be tried first (i.e. sort ascending by cost).
Parameters
prevClasses
prevTokens
tokens
nextTokens
nextClasses
Returns
number