GithubHelp home page GithubHelp logo

ani-hovhannisyan / kanji-visualization Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 1.0 6.95 MB

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.

License: MIT License

Dockerfile 1.66% Python 45.93% HTML 5.36% CSS 2.59% TypeScript 41.75% Shell 0.83% SCSS 1.87%
effective japanese visualization kanji-learning kanji-words python react

kanji-visualization's Introduction

kanji-visualization's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

teruto725

kanji-visualization's Issues

The "react-scripts: not found" error occures when running frontend react server

The following error occurs when trying to run frontend environment in local PC without docker (react server):
$ yarn start

yarn run v1.22.17
$ react-scripts start
/bin/sh: 1: react-scripts: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Clean up GraphView.tsx towards function integration

Clean up some code snippets in frontend/src/GraphView/GraphView.tsx that were temporarily added towards function integration

  • Remove test data import.
import testData from "./testData.json";
  • Change nodes and links to required properties.
interface GraphData {
  nodes?: ExtendedNodeObject[];
  links?: {
    source: string;
    target: string;
  }[];
}
  • Change graphData to required property.
interface Props {
  graphData?: GraphData;
}
  • Change testData to props.graphData.
  return (
    <ForceGraph2D
      ...
      graphData={testData}

Reduce kana from drawing in kanji graph view.

As discussed in #59 PR, remove all words from nodes which contain other than kanji, e.g. okurigana containing words, as it's not the case from current domain diagram.
Use same method as SearchController does for checking one kanji input.

Add test for backend REST APIs

Add test which will test the get request to get kanji graph data. Follow this:
https://docs.google.com/document/d/1q9L0y9OQzgb0q9xUPpt3rnvNsbCtOJyu7gly8lK9lgk/edit# REST API in server side section. Implementation is in main.py
Currently, I test like this in command line:
Request: curl localhost:8000/kanji-visualize
Response: {"detail":[{"loc":["query","kanji"],"msg":"field required","type":"value_error.missing"}]}

Should have same json as in graph view testing, and compare both when the response comes.

Properly define and explain the detais of design pattern in backend python

Currently, I considered 3 controller classes (singleton mostly), but two of it have to process the data which is very close to each other, both Info and Graph represent kanji properties. If we later support the search history, it will be good to keep the track of all objects of kanjis in one class.
But I'm not sure which pattern is better in python when proceeding it for responding in API.
Will patterns like adapter or abstract work? which will mostly fit in here? Which are the best practices in python server side when responding some search results?
See the link https://refactoring.guru/design-patterns/python

The "Html Webpack Plugin" errors occur when running frontend server.

Hi, I'm trying to setup locally wihtout docker, by following current readme steps. I avoid the #13 error via "--ignore-engines" and run frontend server.
However, it responds with following error in webpage:

Html Webpack Plugin:
  Error: Child compilation failed:
  Module.createRequire is not a function
  - child-compiler.js:169 childCompiler.runAsChild
    [frontend]/[html-webpack-plugin]/lib/child-compiler.js:169:18
  - Compiler.js:559 compile
    [frontend]/[webpack]/lib/Compiler.js:559:11
  - Compiler.js:1129 hooks.afterCompile.callAsync.err
    [frontend]/[webpack]/lib/Compiler.js:1129:17
  - next_tick.js:68 process._tickCallback
    internal/process/next_tick.js:68:7
  

And an error in webpage console is:

Uncaught Error: Target container is not a DOM element.
    at Object.render (bundle.js:33330)
    at Module../src/index.tsx (bundle.js:214)
    at Module.options.factory (bundle.js:42557)
    at __webpack_require__ (bundle.js:42007)
    at bundle.js:43196
    at bundle.js:43198
WebSocketClient.js:16 WebSocket connection to 'ws://localhost:3000/ws' failed:

It seems like there are react version problems, or maybe, as I use --ignore-engines option it didn't fully install necessary modules.

Connect SearchField and GraphView

  • Update type handling related to JSON Format in frontend (especially in SearchField)
    • For more information about JSON Format, see this link.
  • Connect SearchField and GraphView and make it ready to connect to the backend.

[backend]Create Info controller

Create Info controller

Class Info controller
offer only get_kanji_info function
- Input: kanji (ex 山)
- Output: dictionary (ex { “onyomi”: san, “kunyomi”: yama})
- Additional you can: return english meaning also
- 

Implement graph drawing logic

  • Decide graph library

  • Create a logic of preparing data to draw the graph nodes and edges

  • Think of what information does contain node and edge in the graph.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.