Hacker News new | ask | show | jobs
Show HN: QWANJI (byronicalpatrick.github.io)
174 points by byronical 808 days ago
Hey HN! I've built this bit of cuteware (software not solving a problem but just for fun) inspired from the patterns made by swipe typing on mobile devices. To me it seemed like the closest thing to an English version of Kanji and it would be cool to consistently recreate those patterns.

The implementation is vanilla js to keep things simple (and from a bit of framework fatigue)

I'm keen to see how people use qwanji. Any and all feedback welcome!

30 comments

I tried making a face; I think I was pretty successful: aetopjgghghghdfdfdfacnk

This method of drawing reminds me of portraits I've seen of "string art" [1], where strings are tied to pins across a board. The detail is not within the strings themselves but in how they intersect. Unfortunately, I couldn't manage this, but I'm sure someone could. Fun project!

[1] https://www.etsy.com/au/market/string_art_portrait

> The detail is not within the strings themselves but in how they intersect. Unfortunately, I couldn't manage this, but I'm sure someone could.

The algorithm for that is kind of inverse tomographic reconstruction. https://en.wikipedia.org/wiki/Tomographic_reconstructionm: “Tomographic reconstruction is a type of multidimensional inverse problem where the challenge is to yield an estimate of a specific system from a finite number of projections”.

Here, you want to find projections for an image.

https://en.wikipedia.org/wiki/Focal_plane_tomography: “In radiography, focal plane tomography is tomography (imaging a single plane, or slice, of an object) by simultaneously moving the X-ray generator and X-ray detector so as to keep a consistent exposure of only the plane of interest during image acquisition. This was the main method of obtaining tomographs in medical imaging until the late-1970s”

A simple algorithm would be to give each string a gray scale that’s the average of the gray scales of the area it passes through. Then, at one particular area, the average gray scale of all strings passing through it more or less equals a weighted average of the average gray scale of the entire picture and that of the area in question.

If you know what areas of the picture are more important, you probably can improve on that method a bit by weighing those areas heavier when computing the darkness of each string.

As an alternative to using many differently colored wires, use the computed gray scale as a probability of whether to use a black or a white wire, or as a probability of whether to include that wire.

Wow, never heard about this before. You've inspired me to have a crack at making a tomographic reconstruction filter myself :)
Let me give it a body:

awtopjgghghghdfdfdfaxvk bgnbgfxcgyjkyrfrsartytyytt

(works best on a narrow smartphone screen)
So I wanted to view my 'palette' of options

If you paste this into the box, you'll get to see all possible shapes generated. You can then combine them to make shapes

And if you remove the spaces, you get an almost solid block. I bet there's a clever way to use them to take a photo and generate some version of it in words

AA AB AC AD AE AF AG AH AI AJ AK AL AM AN AO AP AQ AR AS AT AU AV AW AX AY AZ BA BB BC BD BE BF BG BH BI BJ BK BL BM BN BO BP BQ BR BS BT BU BV BW BX BY BZ CA CB CC CD CE CF CG CH CI CJ CK CL CM CN CO CP CQ CR CS CT CU CV CW CX CY CZ DA DB DC DD DE DF DG DH DI DJ DK DL DM DN DO DP DQ DR DS DT DU DV DW DX DY DZ EA EB EC ED EE EF EG EH EI EJ EK EL EM EN EO EP EQ ER ES ET EU EV EW EX EY EZ FA FB FC FD FE FF FG FH FI FJ FK FL FM FN FO FP FQ FR FS FT FU FV FW FX FY FZ GA GB GC GD GE GF GG GH GI GJ GK GL GM GN GO GP GQ GR GS GT GU GV GW GX GY GZ HA HB HC HD HE HF HG HH HI HJ HK HL HM HN HO HP HQ HR HS HT HU HV HW HX HY HZ IA IB IC ID IE IF IG IH II IJ IK IL IM IN IO IP IQ IR IS IT IU IV IW IX IY IZ JA JB JC JD JE JF JG JH JI JJ JK JL JM JN JO JP JQ JR JS JT JU JV JW JX JY JZ KA KB KC KD KE KF KG KH KI KJ KK KL KM KN KO KP KQ KR KS KT KU KV KW KX KY KZ LA LB LC LD LE LF LG LH LI LJ LK LL LM LN LO LP LQ LR LS LT LU LV LW LX LY LZ MA MB MC MD ME MF MG MH MI MJ MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NB NC ND NE NF NG NH NI NJ NK NL NM NN NO NP NQ NR NS NT NU NV NW NX NY NZ OA OB OC OD OE OF OG OH OI OJ OK OL OM ON OO OP OQ OR OS OT OU OV OW OX OY OZ PA PB PC PD PE PF PG PH PI PJ PK PL PM PN PO PP PQ PR PS PT PU PV PW PX PY PZ QA QB QC QD QE QF QG QH QI QJ QK QL QM QN QO QP QQ QR QS QT QU QV QW QX QY QZ RA RB RC RD RE RF RG RH RI RJ RK RL RM RN RO RP RQ RR RS RT RU RV RW RX RY RZ SA SB SC SD SE SF SG SH SI SJ SK SL SM SN SO SP SQ SR SS ST SU SV SW SX SY SZ TA TB TC TD TE TF TG TH TI TJ TK TL TM TN TO TP TQ TR TS TT TU TV TW TX TY TZ UA UB UC UD UE UF UG UH UI UJ UK UL UM UN UO UP UQ UR US UT UU UV UW UX UY UZ VA VB VC VD VE VF VG VH VI VJ VK VL VM VN VO VP VQ VR VS VT VU VV VW VX VY VZ WA WB WC WD WE WF WG WH WI WJ WK WL WM WN WO WP WQ WR WS WT WU WV WW WX WY WZ XA XB XC XD XE XF XG XH XI XJ XK XL XM XN XO XP XQ XR XS XT XU XV XW XX XY XZ YA YB YC YD YE YF YG YH YI YJ YK YL YM YN YO YP YQ YR YS YT YU YV YW YX YY YZ ZA ZB ZC ZD ZE ZF ZG ZH ZI ZJ ZK ZL ZM ZN ZO ZP ZQ ZR ZS ZT ZU ZV ZW ZX ZY ZZ

>if you remove the spaces, you get an almost solid block.

Removed spaces for easy copy pasta

AAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJBKBLBMBNBOBPBQBRBSBTBUBVBWBXBYBZCACBCCCDCECFCGCHCICJCKCLCMCNCOCPCQCRCSCTCUCVCWCXCYCZDADBDCDDDEDFDGDHDIDJDKDLDMDNDODPDQDRDSDTDUDVDWDXDYDZEAEBECEDEEEFEGEHEIEJEKELEMENEOEPEQERESETEUEVEWEXEYEZFAFBFCFDFEFFFGFHFIFJFKFLFMFNFOFPFQFRFSFTFUFVFWFXFYFZGAGBGCGDGEGFGGGHGIGJGKGLGMGNGOGPGQGRGSGTGUGVGWGXGYGZHAHBHCHDHEHFHGHHHIHJHKHLHMHNHOHPHQHRHSHTHUHVHWHXHYHZIAIBICIDIEIFIGIHIIIJIKILIMINIOIPIQIRISITIUIVIWIXIYIZJAJBJCJDJEJFJGJHJIJJJKJLJMJNJOJPJQJRJSJTJUJVJWJXJYJZKAKBKCKDKEKFKGKHKIKJKKKLKMKNKOKPKQKRKSKTKUKVKWKXKYKZLALBLCLDLELFLGLHLILJLKLLLMLNLOLPLQLRLSLTLULVLWLXLYLZMAMBMCMDMEMFMGMHMIMJMKMLMMMNMOMPMQMRMSMTMUMVMWMXMYMZNANBNCNDNENFNGNHNINJNKNLNMNNNONPNQNRNSNTNUNVNWNXNYNZOAOBOCODOEOFOGOHOIOJOKOLOMONOOOPOQOROSOTOUOVOWOXOYOZPAPBPCPDPEPFPGPHPIPJPKPLPMPNPOPPPQPRPSPTPUPVPWPXPYPZQAQBQCQDQEQFQGQHQIQJQKQLQMQNQOQPQQQRQSQTQUQVQWQXQYQZRARBRCRDRERFRGRHRIRJRKRLRMRNRORPRQRRRSRTRURVRWRXRYRZSASBSCSDSESFSGSHSISJSKSLSMSNSOSPSQSRSSSTSUSVSWSXSYSZTATBTCTDTETFTGTHTITJTKTLTMTNTOTPTQTRTSTTTUTVTWTXTYTZUAUBUCUDUEUFUGUHUIUJUKULUMUNUOUPUQURUSUTUUUVUWUXUYUZVAVBVCVDVEVFVGVHVIVJVKVLVMVNVOVPVQVRVSVTVUVVVWVXVYVZWAWBWCWDWEWFWGWHWIWJWKWLWMWNWOWPWQWRWSWTWUWVWWWXWYWZXAXBXCXDXEXFXGXHXIXJXKXLXMXNXOXPXQXRXSXTXUXVXWXXXYXZYAYBYCYDYEYFYGYHYIYJYKYLYMYNYOYPYQYRYSYTYUYVYWYXYYYZZAZBZCZDZEZFZGZHZIZJZKZLZMZNZOZPZQZRZSZTZUZVZWZXZYZZ

I tried to draw some hanzi (Kanji).

rsdcygjnbm ebycdomhl

    你        好
It is like written by someone really drunk though...

But the stroke order is correct and I would say native speakers (like me) can recognize them.

It always amazes me how good Gboard is at figuring out long single-"stroke" hanzi/kanji scrawls if you have the right stroke order
> It is like written by someone really drunk though...

Try approximating a 草書 form.

One problem with using this to draw 字 is the lack of vertical strata. Just look at the character 子: it has five distinct vertical positions. (Initial topbar, bottom of the hook down from the topbar, bottom of the vertical stroke, top of the hook up from the vertical stroke, and the crossbar.) But QWANJI has only three distinct vertical levels.

I've seen a font where 女 (actually, the 女字旁) is represented as a symmetrical form, kind of like if the 点 in the top center of 义 were replaced by a 横 going through the other two strokes. That reduces the count of vertical coordinates from 5 to 4. I imagine adapting characters to QWANJI would take quite a lot of that kind of thing.

> One problem with using this to draw 字 is the lack of vertical strata.

Totally agree. Adding the number row on the keyboard should be helpful but make QWANJI less like a language.

Yeah the "drunk script" look is to avoid straight lines hiding multiple paths. Cool that it's recognisable though!
"QWANJI" in QWANJI: ravkrkvn rbhni ztmhah zenunez zzzzvuuvz yinbmnip
LG also has this as a keyboard input feature named "Swype".

See https://en.m.wikipedia.org/wiki/Swype (Not LG but seems like it's the same thing and same name)

The original swype algorithm was far better than whatever ML-stuff gboard and iOS have these days.
Yes it's oddly not great in places. It seems to suffer from "YouTube syndrome" where it gets hooked onto something you searched for/saved once. Just because I once entered "Aldi" manually, now that always seems to have an extremely heavy positive weighting, even though I've only actually wanted it a very small number of times and "also" is far more likely as it is used at a 20:1 ratio, and I'm endlessly deleting "Aldi". Trivial Bayesian type things aside, even basic linguistic analysis, let alone an AI superpower, could estimate when "Aldi" and "also" are each appropriate in context from earlier words.

Another example: what was more likely after "20:1": "ratio" or "radio"? Get it tighter^Wtogether!

> Just because I once entered "Aldi" manually, now that always seems to have an extremely heavy positive weighting, even though I've only actually wanted it a very small number of times and "also" is far more likely as it is used at a 20:1 ratio, and I'm endlessly deleting "Aldi".

I'm using Google Pinyin Input, which is discontinued. (I use it anyway because the replacement input methods are worse. Don't ask me why they stripped useful functionality in order to replace it with nothing.)

It has swipe input, but as far as I can tell it isn't possible to add words to the swipe input dictionary. However, if that were possible, your problem wouldn't exist - the way the system works is that you swipe something, the system's first guess appears in the text input, and a bar of suggestions appears over the top of the keyboard. If the first guess was wrong, you can select from the suggestion bar, and the word in the text input will be changed to whatever you selected.

So I'm kind of bemused at the idea that you need to be deleting wrong guesses.

Ok, changing it then, bit^Wnot felting^Wdeleting (though since much of the time the wing^Wwrong guess isn't even there, but rather it's plurals and verb forms and si^Wso on, I do often need to refocus away from the import^Winput fitting^Wfield, pause, scan, conclude the right word isn't there, then delete anyway, so my muscle memory is to go for the delete key). It's still a suboptimal experience because the keys for the next weird^Wword like punctuation are at the bottom and the wing^Wwrong guesses mean you have to scan the list at the top.

These ^W marks are all organic mistakes that it really shouldn't be making so many of considering the word prevent^W placement[1] and statistics and thousand upon thousands of units^Wunless^Wit's^Winputs.

Maybe it's the never^Wnerve damage in my diggers^Wfingers making me sort^Wsuper clumsy, or being a lefty makes it wise^Wworse sommelier^Wsomehow, but I do remember it being better, far better, in the past. And it never, ever, send^Wseems to learn (I don't have Google services so maybe it needs to phone home to learn?)

It seems possible to add words: you type then^Wthem n^Win and choose then^Wthem from the bar m^W.

But thank you for so kindly telling me I'll^WI'm once-unimaginable^Wimagining[2] it.

[1] take this one for example: "considering the word prevent" isn't grammatical, but "considering the word prevent^Wprevent^Wplacement (argh again! Twice! And prevent^Wplacement want^Wwasn't in the list, it was prevention, preventing and prevents) is.

[2] "once-unimaginable" is one I put in by typing it once as it has little concept of compound Shane^Wadjectives. It seems to completely hallucinate the "once-un" to prioritise a previous manual unit^Winput. But I can't actually swipe to get it again, no matter how carefully I go. I get "once-imagined".

I have been using SwiftKey for many years and their swipe and typing prediction are top notch.
I know! Every day when GBoard breaks down on its "glide" feature I miss my Swype. It was such an amazing keyboard, it's just plain sad.
This is why core technology shouldn't be proprietary IP. It should all be open source.
I was really sad when Swype shut down a few years ago. Is there any app with that level of quality available today?

I don't understand how things still haven't gotten better after over a decade, especially with the boom in AI and phone processing power.

You can do this now on your iPhone
Feedback: Make this shareable by setting a hash in the URL path. Even better if you could include the generated picture in the OG tags.
Thanks for the feedback! Added the link sharing but the OG tags looked like a bigger task (and SVG might not be supported?)
ywshbz tqagazb zqbt qzgq zqby qzbt qzjq bzagaqy zvfaqr
I made something a bit similar to this when trying to make a new shorthand. It was made by translating to stenotype and then following rules to convert the stenotype runes to a kanji like form. Eventually I decided it wasn’t faster than existing shorthand, mainly because of the mental overhead of converting to and from stenotype.

I never coded it (I only used it a few times for handwriting before I decided it was bad) but it might be a cool project.

This is cute indeed. I had fun doing these

Cyndlc zymalz alztma xymslx zrbajz

abezoa
“Welcome” is a nice one.
Interesting. I recently built a non stop drag system for someone who uses it to communicate. The system uses either a dwell or angular detection system to figure out the letters. I wonder though if some path analysis would be better. I wonder if you can reverse this - so from an image of the path (and with time stamp along the path) you can go path -> text.

https://github.com/AceCentre/DragToSpeak see video of it in action https://willwa.de/2024/03/26/iterative-rapid-development.htm...

Saw a couple comments around making the link shareable which makes sense so I made that change. Using the "QWANJI" example @carlos-menezes created: https://byronicalpatrick.github.io/qwanji/#ravkrkvn%20rbhni%...
This is really cool :) A cool next project for you or someone: use ML to see which words produce the most interesting images. "diverge" produces something that looks like a heart for example lol
Thanks! A twist on this would be a program which finds the English word closest to a given shape, but could probably just draw it on a mobile keyboard.
You don’t need an ML, each letter and based on its location on the keyboard draw a predictable path, so you can draw whatever you want somehow
Yeah, but I was imagining iterating over all English words from a dictionary. Using actual words could be more interesting than random characters potentially
feels kind of like writing in cursive

edcdsdfgtgb hgfrytrvbn tgbnm tgbnm ytrfvvbnhyyt

Did not think kanji. Brain went to ouija and jumanji. Pretty neat!
Try 'eight'
fghijklmnf
foobarf
I foobarf you too.
This is a good one lol
rv ergive tbmpo
You should add queries to share link
Please see this previous post for relevant further thoughts on the idea: https://news.ycombinator.com/item?id=37510829 . Additionally I thought it would be cool to have the inputs go in reverse too, like putting in swipes and getting text.
This has problems with repeated characters, like 3 "e"s in "eleven".
Yeah and adjacent double letters. Could randomize the arc of each path, add more weight, or do a little loop to describe double/repeated letters perhaps?
i really thought this was

https://en.wikipedia.org/wiki/Shorthand

at first

xfhyujklm
Two people high fiving: xserfxp qxserfcx
zwrgs dxvg yrfhbc utgjnv ujojn ex vyni wzcfsfrw tv ybmiy
Thanks, another good url for this would be Sigil drawer dot io
Xcbvxtvznz
I guess someone had to do it
Any tool that can make arbitrary illustrations, no matter how complex, convoluted, or limited, can and will always be used to draw dicks.
Would you look at that... https://youtube.com/shorts/KzBpAYbib0c
Cqtov

Cdgjc

Vlgav

Vtybn

Xtyvb

Last two kinda NSFW.

Now I want to be able to do Fourier transformations on these splines or be able to see the words between words in QWERTY space.
sounds like there might be some conspiracy... pls do
Great, another form of steganography has been born.

Have fun hiding information in colemak qwanjis.