ani-hovhannisyan / kanji-visualization

Kanji words visualization graph draws relational graph for kanjis of particular words in Japanese. Aim is to understand the relational graph of one kanji within different words and it's relations to all possible words.
MIT License
5 stars 1 forks source link

Implement InfoController in backend side to prepare Kanji information #38

Closed teruto725 closed 2 years ago

ani-hovhannisyan commented 2 years ago

Implement an InfoController class which receives the data from GraphController or directly from JamDict and reformats it (if necessary). API can be:

ani-hovhannisyan commented 2 years ago

@TakumiHiraide san please use the #3 issue for referring the usage of JamDict.

TakumiHiraide commented 2 years ago

I report about the error. I installed requirements.txt that includes jamdict by "pip install -r ./backend/requirements.txt". However, backend/Infocontroller.py doesn't work. The error is below. File "/Users/takumi-hi/kanji-visualization/kanji-visualization/backend/InfoController.py", line 3, in from jamdict import Jamdict ModuleNotFoundError: No module named 'jamdict' The code InfoController.py is below.

pip install jamdict jamdict-data

from jamdict import Jamdict class InfoController:

from jamdict import Jamdict

def get_jamdict_data():
    jam = Jamdict()
    print("query: ", end="")
    query = input()
    result = jam.lookup(query)
    index = -1
    print(result)

get_jamdict_data()

TakumiHiraide commented 2 years ago

main.py also doesn't work😭. Traceback (most recent call last): File "/Users/takumi-hi/kanji-visualization/kanji-visualization/backend/main.py", line 1, in from fastapi import FastAPI ModuleNotFoundError: No module named 'fastapi'

TakumiHiraide commented 2 years ago

Maybe I don't understand the basic import structure of python.

ani-hovhannisyan commented 2 years ago

@TakumiHiraide Is this error still exist? Does main.py work or no?

TakumiHiraide commented 2 years ago

This code works because no error message appears. Does this confirm that the Fast API is working? スクリーンショット 2022-02-10 12 34 06

ani-hovhannisyan commented 2 years ago

Closing as it works fine on both of sides.