GithubHelp home page GithubHelp logo

asdfjkl / kanjicanvas Goto Github PK

View Code? Open in Web Editor NEW
53.0 53.0 9.0 17.72 MB

Online Kanji (Japanese Character) Recognition in Javascript

Home Page: https://asdfjkl.github.io/kanjicanvas/

License: Other

Python 100.00%

kanjicanvas's People

Contributors

asdfjkl avatar creedflan738 avatar sethclydesdale avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kanjicanvas's Issues

Adding a Dataset for Characters Represented by Surrogate Pairs

Adding a Dataset for Characters Represented by Surrogate Pairs

Abstraction

Thank you for the wonderful tool. I really like this project. 😄

When trying to add a dataset, I encountered some issues using jTegaki.

Background Only One Character with a Single Code Point Can Be Registered

When setting the background, Unicode input is required, but characters represented by surrogate pairs are not considered.

Looking into the jTegaki source code decompiled with Java Decompiler, I found that it simply parses the hex of one block into a number and casts it to a char.

int val_of_si = Integer.parseInt(s, 16);
char c_si = (char)val_of_si;
String si = Character.toString(c_si);
this.sp.setBackground(si);
this.sp.repaint();

Request

Could jTegaki be improved to allow the addition of a dataset for characters represented by surrogate pairs?

String input = "845B DB40 DD00"; // input from

String[] codePoints = input.split(" ");
StringBuilder result = new StringBuilder();

for (String codePoint : codePoints) {
    int cp = Integer.parseInt(codePoint, 16);
    result.append(Character.toChars(cp));
}

I considered making the improvement myself, but since the source code is not publicly available and the license is unclear, I decided to raise an issue.

Missing Kanji

Below is a list of missing kanji that would be really useful to include as they're part of the dataset used in RTK.

I couldn't find them in the ref patterns at least.

I think they should be supported by default.

Other than those few missing kanji, super great project and I really enjoy it.

吾
朋
昌
旭
亘
只
頁
肌
勺
汐
砂
填
圭
鯉
林
桂
柏
梢
杏
桐
沫
荻
王
銑
辻
敬
幌
嬌
匕
蝶
独
進
曰
描
掲
乃
允
裳
敢
徳
街
数
笠
笹
篭
匁
勿
伊
漕
散
廿
之
智
弘
猪
渚
阿
窪
苑
酉
梓
摯
菱
亥
椿
錘
栗
楠
枢
彦
亜
蒲
航
瓜
函
脹
烏
蔦
鳩
薦
寅
辰
丑
卯
巳

I started forked project!

@asdfjkl

Hello. Thank you for the wonderful project.
I love this project.

For use in various projects, I've published a forked version of the project as an alpha version.
https://github.com/Ubugeeei/tecack
https://ubugeeei.github.io/tecack

The objectives of this project are:

  • To make it installable via npm
  • Package each functionality individually
  • TypeScript support
  • Set up an environment for creating character data
  • Comprehensive documentation
  • Easier setup

KanjiCanvas is released under the MIT license, but I would like to confirm that there are no licensing issues just to be safe.

If there is an issue, I will immediately take it down. What do you think?

I reached out through an issue because the discussion was not open.

Adding new refPatterns

Hello,

Firstly I'd like to thank you for the work you've done on this project! I found it the most suitable for what I wanted to accomplish, which was to create stroke order exercises for the Genki textbooks and it has worked incredibly well thus far! You can view it online here. (this is also a debug link, so you can view output in the web console when clicking "next") I've also mentioned the project in the readme as thanks.

Anyway, onto my question! I was wondering how to add new refPatterns or what method you used to add them? I was wanting to add the following kanji as they were the only patterns I'm missing.

小, 自, 々, 彼, 供, 服, 夕

I tired using the copyStuff() function after drawing the kanji, however, the patterns returned seem to be inaccurate and pollute the candidates list. For example, this was the output for 小:

["小", 3, [[101.5,72.125,101.5,72.125,101.5,73.125,101.5,73.125,101.5,74.125,101.5,74.125,101.5,75.125,101.5,75.125,101.5,76.125,101.5,76.125,101.5,77.125,101.5,77.125,101.5,78.125,101.5,78.125,101.5,79.125,101.5,79.125,101.5,80.125,101.5,80.125,101.5,81.125,101.5,81.125,101.5,82.125,101.5,82.125,101.5,83.125,101.5,83.125,101.5,84.125,101.5,84.125,101.5,85.125,101.5,85.125,101.5,86.125,101.5,86.125,101.5,87.125,101.5,87.125,101.5,88.125,101.5,88.125,101.5,89.125,101.5,89.125,101.5,90.125,101.5,90.125,101.5,91.125,101.5,91.125,101.5,92.125,101.5,92.125,101.5,93.125,101.5,93.125,101.5,94.125,101.5,94.125,101.5,95.125,101.5,95.125,101.5,96.125,101.5,96.125,101.5,97.125,101.5,97.125,101.5,98.125,101.5,98.125,101.5,99.125,101.5,99.125,101.5,100.125,101.5,100.125,101.5,101.125,101.5,101.125,101.5,102.125,101.5,102.125,100.5,102.125,100.5,102.125,100.5,103.125,100.5,103.125,100.5,104.125,100.5,104.125,100.5,105.125,100.5,105.125,100.5,106.125,100.5,106.125,100.5,107.125,100.5,107.125,100.5,108.125,100.5,108.125,100.5,109.125,100.5,109.125,99.5,109.125,99.5,109.125,99.5,110.125,99.5,110.125,98.5,110.125,98.5,110.125,98.5,111.125,98.5,111.125,97.5,111.125,97.5,111.125,97.5,112.125,97.5,112.125,96.5,112.125,96.5,112.125,96.5,113.125,96.5,113.125,95.5,114.125,95.5,114.125,94.5,115.125,94.5,115.125,93.5,115.125,93.5,115.125,93.5,116.125,93.5,116.125,92.5,116.125,92.5,116.125,91.5,116.125,91.5,116.125,91.5,117.125,91.5,117.125,91.5,118.125,91.5,118.125,90.5,118.125],[87.5,81.125,87.5,81.125,87.5,82.125,87.5,82.125,87.5,83.125,87.5,83.125,87.5,84.125,87.5,84.125,87.5,85.125,87.5,85.125,87.5,86.125,87.5,86.125,87.5,87.125,87.5,87.125,87.5,88.125,87.5,88.125,86.5,88.125,86.5,88.125,86.5,89.125,86.5,89.125,86.5,90.125,86.5,90.125,86.5,91.125,86.5,91.125,85.5,91.125,85.5,91.125,85.5,92.125,85.5,92.125,84.5,92.125,84.5,92.125,84.5,93.125,84.5,93.125,84.5,94.125,84.5,94.125,83.5,94.125,83.5,94.125,83.5,95.125,83.5,95.125,83.5,96.125,83.5,96.125,82.5,96.125,82.5,96.125,81.5,96.125,81.5,96.125,81.5,97.125,81.5,97.125,80.5,97.125,80.5,97.125,80.5,98.125,80.5,98.125,79.5,98.125,79.5,98.125,79.5,99.125,79.5,99.125,78.5,99.125,78.5,99.125,77.5,99.125,77.5,99.125,77.5,100.125,77.5,100.125,76.5,100.125,76.5,100.125,75.5,100.125,75.5,100.125,75.5,101.125,75.5,101.125,75.5,102.125],[111.5,81.125,111.5,81.125,112.5,81.125,112.5,81.125,112.5,82.125,112.5,82.125,112.5,83.125,112.5,83.125,113.5,83.125,113.5,83.125,113.5,84.125,113.5,84.125,114.5,85.125,114.5,85.125,114.5,86.125,114.5,86.125,114.5,87.125,114.5,87.125,115.5,87.125,115.5,87.125,115.5,88.125,115.5,88.125,116.5,89.125,116.5,89.125,116.5,90.125,116.5,90.125,117.5,90.125,117.5,90.125,117.5,91.125,117.5,91.125,118.5,91.125,118.5,91.125,119.5,92.125,119.5,92.125,119.5,93.125,119.5,93.125,120.5,93.125,120.5,93.125,120.5,94.125,120.5,94.125,121.5,94.125,121.5,94.125,121.5,95.125,121.5,95.125,121.5,96.125,121.5,96.125,122.5,96.125,122.5,96.125,123.5,96.125,123.5,96.125,124.5,96.125,124.5,96.125,124.5,97.125,124.5,97.125,124.5,98.125,124.5,98.125,125.5,98.125,125.5,98.125,126.5,98.125]]]

With this in the refPatterns, drawing 一, 二, 三, or random lines 1-4 for example, always has 小 as the first candidate which feels off.

I'm thinking perhaps I may have did something wrong, so I figured I'd ask to learn what method you went about for adding the current refPatterns.

How to make it work with hiragana letters?

first I really love this repo you did a really good job.😊❤
i testing this and i want to know if there is a way to make i work with Japanese hiragana characters?😄

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.