Question
please help JAVA implementation Complete the main method in BaseMain.java. It should: Load data-kanji.txt, use it to populate a hashtable that maps IDs to characters,
please help JAVA implementation
Complete the main method in BaseMain.java. It should: Load data-kanji.txt, use it to populate a hashtable that maps IDs to characters, and add the IDs as nodes in the graph. Load data-components.txt, and use it to add edges to the graph being built. Create an IntuitiveTopological object, and use it to sort the graph. Display the characters in the ordering. Note that topological sort will produce a list of a IDs - you'll need to take the IDs and uses them to look up the correct character in the hashtable you populated earlier.
Please find BaseMain.java below
/** * Program for generating kanji component dependency order via topological sort. */ public class BaseMain { /** * Entry point for testing. * @param args the command line arguments */ public static void main(String[] args) { //TODO: implement this
//Freebie: this is one way to load the UTF8 formated character data. //BufferedReader indexReader = new BufferedReader(new InputStreamReader(new FileInputStream(new File("data-kanji.txt")), "UTF8")); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started