code: def similarity_by_infocontent(sense1: "wn.Synset", sense2: "wn.Synset", option: str) -> float:
      
  
      if sense1.pos != sense2.pos: # infocontent sim can't do diff POS.
          return 0
  
      if option in ['res', 'resnik']:
          if sense1.pos not in wnic_bnc_resnik_add1.ic:
              return 0
          return wn.res_similarity(sense1, sense2, wnic_bnc_resnik_add1)
      #return min(wn.res_similarity(sense1, sense2, wnic.ic(ic)) \
      #             for ic in info_contents)
  
      elif option in ['jcn', "jiang-conrath"]:
          if sense1.pos not in wnic_bnc_add1.ic:
              return 0
          return wn.jcn_similarity(sense1, sense2, wnic_bnc_add1)
  
      elif option in ['lin']:
          if sense1.pos not in wnic_bnc_add1.ic:
              return 0
          return wn.lin_similarity(sense1, sense2, wnic_bnc_add1)
docs: Returns similarity scores by information content.
  
      :param sense1: A synset.
      :param sense2: A synset.
      :param option: String, one of ('res', 'jcn', 'lin').
      :return: A float, similarity measurement.