Refactor generate_java_code and enumerate register cases for on-the-fly orthography.