```
def generateAbbreviations(self, word):
ans = [[]]
for c in word:
new_ans = []
for l in ans:
new_ans.append(l+[c])
if len(l)>0 and l[-1].isdigit():
l[-1] = str(int(l[-1])+1)
new_ans.append(l)
else:
new_ans.append(l+['1'])
ans = new_ans
return [''.join(x) for x in ans]
```

this is similar to the solution of the problem "Permutation" in some way. https://leetcode.com/discuss/19510/my-ac-simple-iterative-java-python-solution