'>>> N[\'dog\'][0].synset[0] == N[\'dog\'][0]
1
>>> N[\'dog\'][0].synset[\'dog\'] == N[\'dog\'][0]
1
>>> N[\'dog\'][0].synset[N[\'dog\']] == N[\'dog\'][0]
1
>>> N[\'cat\'][6]
\'cat\' in {noun: big cat, cat}'

def __getitem__(self, idx):

    senses = self.getSenses()
    if isinstance(idx, Word):
        idx = idx.form
    if isinstance(idx, StringType):
        idx = (_index(idx, map((lambda sense: sense.form), senses)) or _index(idx, map((lambda sense: sense.form), senses), _equalsIgnoreCase))
    return senses[idx]
