如何将未排序的单词列表转换为元组列表(单词,计数),按单词排序(fst)min-max 不区分大小写?
["AAA","America", "England", "Spain"," Ireland"," aeroplane",
"aeroplane", "Aeroplane", "AeRoPlAne", "helicopter", "HELICOPTER",
"Zebra", "America", "Elephant", "abc", "A.B.C." , "haskell", "Haskell", "ZZZ", "zzz"]
预期产出:
[("a.b.c.",1),("aaa",1),("abc",1),("aeroplane",4),("america",2),("elephant",1)
,("england",1),("haskell",2),("helicopter",2),("ireland",1),("spain",1),("zebra",1),("zzz",2)]
[("a.b.c",1), ("zzz", 2)]