Closed teruto725 closed 2 years ago
During exploration of how to interact with the db for Graph, and how to parse the words list I found TheKanjiMap project data is enough for now and easy to process for later Graph Drawing. So will use that instead of JamDict.
As for preparing the nodes format task I need the format of GraphView nodes, so will wait for the input from Graph View task.
Renamed graph-controller branch to feature/graph-controller. (deleted graph-controller and added the new one)
Connecting methods between controllers are done by @teruto725.
Implemented draft version of constructing graph using local cached DB taken from "The Kanji Map" project data #3 Graph Controller loads the DB, finds necessary kanji, reconstructs the db json. then cleans up and prepares specific format defined by GraphView #52 (#55 not sure).
The request will get following response, from Graph all nodes and links are constructed as described in #52 :
{
"graphMatrix": {
"nodes": [{
"id": "柳"
}, {
"id": "き"
}, {
"id": "ゅ"
}, {
"id": "う"
}, {
"id": "山"
}, {
"id": "四"
}, {
"id": "川",
"isMain": "true"
}, {
"id": "上"
}, {
"id": "堀"
}, {
"id": "河"
}, {
"id": "下"
}, {
"id": "江"
}, {
"id": "戸"
}, {
"id": "小"
}],
"links": [{
"source": "川",
"target": "柳"
}, {
"source": "川",
"target": "き"
}, {
"source": "き",
"target": "ゅ"
}, {
"source": "ゅ",
"target": "う"
}, {
"source": "山",
"target": "川"
}, {
"source": "四",
"target": "川"
}, {
"source": "川",
"target": "上"
}, {
"source": "堀",
"target": "川"
}, {
"source": "河",
"target": "川"
}, {
"source": "川",
"target": "下"
}, {
"source": "江",
"target": "戸"
}, {
"source": "戸",
"target": "川"
}, {
"source": "小",
"target": "川"
}]
},
"kanjiInfo": {
"kunyomi": "かわ",
"onyomi": "",
"meaning": "stream"
}
}
Note: There might happen to have errors, as I still didn't add else case handling in GC(GraphController). The furigana endings and non kanji words aren't handled yet. Should clean from main.py and other responses to have exact matching format for json.
Closing issue as nor important problems and opening DB clean up and enhancement/bug fixing tasks.
Implement the Graph Controller class in the server side.
[x] Create necessary empty interfaces between SearchController, InfoController, GraphView classes.
[x] Prepare nodes format to pass to GraphView (related to #37 )