1. A computer-implemented method of matching ordered sequences comprising: removing recursion among the sequences by replacing a recurring sequence with a single instance of recursion; removing stop words in the sequences; pruning the sequences to identify candidate sequences to be examined further; obtaining relative importance weights of symbols in the candidate sequences based on symbol frequency; and finding the maximum match among the candidate sequences by optimizing a cost function based on weighted sequence similarity.