<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lch_similarity(self, synset):
 """Calculates Leacock and Chodorow's similarity between the two synsets. Notes ----- Similarity is calculated using the formula -log( (dist(synset1,synset2)+1) / (2*maximum taxonomy depth) ). Parameters synset : Synset Synset from which the similarity is calculated. Returns ------- float Leacock and Chodorow's from `synset`. None, if synsets are not connected via hypernymy/hyponymy relations. Obvious, if part-of-speeches don't match. """


        if self._raw_synset.pos != synset._raw_synset.pos:
            return None

        depth = MAX_TAXONOMY_DEPTHS[self._raw_synset.pos] 

        distance = self._shortest_path_distance(synset)      

        if distance >= 0: 
            return -math.log((distance + 1) / (2.0 * depth)) 
        else: 
            return None