# How to define Similarity Rules?

I have a question about Mathematica's SimilarityRules defining (for e.g. SequenceAlignment function). So help centre clearly stands for

SimilarityRules -> {{a_, a_} -> 1, {a_, b_} -> -1}, giving a score of +1 for any pair of identical elements, and a score of -1 for any mismatch, deletion or insertion.

Ok, I get it, but what if I want to give different score for mismatch, and different for indeles? I tried:

SimilarityRules -> {{a_, a_} -> 3, {{a_, b_} && {{a_!=""} && {b_ != ""}}} -> -8}


and many other combination of {}, && positions, but it doesn't seem to help. Any suggestions, is it just a typo I'm doing, or it's rather a silly idea to define it like this?

-
You could add a test case (with desired output) to make the question more comprehensive. –  Yves Klett Jul 30 '13 at 8:59
For instance: SimilarityRules -> {{a_, a_} -> 3, {a_ /; a != "", b_ /; b != ""} -> -8}