Abbreviations, automatic: Difference between revisions

Content deleted Content added
Hout (talk | contribs)
Hout (talk | contribs)
Line 1,587: Line 1,587:
return next(
return next(
len(a[0]) for a in map(
len(a[0]) for a in map(
compose(nub)(_map(concat)),
compose(nub)(
transpose(map(inits, xs))
_map(concat)
),
transpose(
map(inits, xs)
)
) if n == len(a)
) if n == len(a)
)
)
Line 1,598: Line 1,602:
readFile('weekDayNames.txt')
readFile('weekDayNames.txt')
)))
)))
for i, n in enumerate(map(compose(abbrevLen)(words), xs)):
for i, n in enumerate(
map(
compose(abbrevLen)(words),
xs
)
):
print (n, ' ', xs[i])
print (n, ' ', xs[i])