Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AOEU eye
AU awe
H-F {?}
HAOEUF hive
HAUF half
HR-FR elevator
HRAOEUFR lifer
HRAUFR law officer
HROEFR loafer
K-G kilogram
KH-FG `
KOEG coag
KPWAOEUPBG combining
KW-BG {,}
OE owe
P-P {^.^}
PAOEUP pipe
POEP pope
PW-PB been
PWAOEUPB bein
PWHOEFPB Beethoven
PWOEPB bone
RAOEUR require
RAUR rawr
ROER roar
S-S {^s is}
S-T is the
S-TS cents
SAOEUT sight
SAUS sauce
SAUT sought
SK-GS is asking
SKOEGS Scotia
SKWR-RBGS {^...}{-|}
SOET society
SOETS societies
SP-PT {;}
SRAOEURS virus
SRAOEURT variety
SRAOEURTS varieties
SROERS adviser
SROERT voter
ST-LT stoplight
ST-LTS stoplights
STAOEULT subtitle
STAOEULS styles
STAULS stalls
STAULT salt
STOELT total
STPAOEUPLS sometimes
STPH-FPLT {:}
STPH-FPLTS {(^}
SW-BS {^...}
SWAUBS sexual abuse
T-L it'll
TAOEUL tile
TAUL tall
TH-FL {^;^}
THAUFL thoughtful
TKAOEULG dialing
TKPWAUPBLG gauge
TKPWR-RPBLG grand juror
TOEL tole
TP-PL {.}
TPAOEUPL if I'm
TPH-FPL {&n-}
TPOEPL foam
TPR-RPL {.}{^
^}{-|}
TPROERPL former
TR-RL {~|`^}
W-B {^,^}
WR-RB whereby
const fs = require('fs');
const { convertChord } = require('/home/timothy/phl-2-ep-2/data/convertChord');
const fileString = fs.readFileSync('/home/timothy/Downloads/plover/plover/assets/main.json').toString();
const dictionary = JSON.parse(fileString);
const strokes = Object.keys(dictionary);
const singleStrokes = strokes.filter(s => !s.includes('/'));
const isPalindrome = s => s.length <= 1 ? true : s[0] === s[s.length - 1] && isPalindrome(s.substring(1, s.length - 1));
const symmetrical = singleStrokes.filter(s => {
const chord = convertChord(s);
if (chord.has('d') || chord.has('z') || '1234567890'.split('').some(n => chord.has(n))) return false;
const order = 'STKPWHRAO-*EUrfbpgl';
let binaryString = '';
for (const c of order) {
binaryString += chord.has(c) ? '1' : '0';
}
binaryString += (chord.has('t') || chord.has('s')) ? '1' : '0';
return isPalindrome(binaryString);
});
symmetrical.forEach(s => console.log(s, dictionary[s]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.