Automating the creation of letter map

Instead of manually creating lettermap to get the alphabet index for
sorting