Skip to content

Instantly share code, notes, and snippets.

View Calvin-Xu's full-sized avatar
๐ŸŒน
่‡ช็”ฑใ‚’่ˆžใ†่–”่–‡ใฎใ‚ˆใ†ใซใ€€็งใฏไธ–็•Œใ‚’ๅค‰ใˆใ‚‹

Calvin Xu Calvin-Xu

๐ŸŒน
่‡ช็”ฑใ‚’่ˆžใ†่–”่–‡ใฎใ‚ˆใ†ใซใ€€็งใฏไธ–็•Œใ‚’ๅค‰ใˆใ‚‹
View GitHub Profile
@Calvin-Xu
Calvin-Xu / furigana.py
Last active June 27, 2025 22:48
Generating reading pairs / furigana string
from enum import Enum
from typing import Dict, List, Tuple
from jaconv import kata2hira
import unicodedata
def generate_possible_kanji_reading_pairs(
text: str, reading: str
) -> List[List[Tuple[str, str]]]:
"""
// part of https://github.com/Calvin-Xu/Allegorical-Lisp-Machine
// that does not disclose CS 107E assignment implementations
// based on The Roots of Lisp by Paul Graham that follows closely McCarthy's original paper
// Lisp in 99 lines of C and how to write one yourself by Robert van Engele
#include "lisp.h"
#include "printf.h"
#include "utils.h"
#include "strings.h"
@Calvin-Xu
Calvin-Xu / math.c
Last active March 23, 2023 08:20
Implementation of some math.h functions
// uses only elementary methods
// guarantees none of speed, precision or accuracy
// I didn't read the specs
// does not handle any errors
// might be educational; definitely not practical
#include "math.h"
// double has 53 bits mantissa
// precision is log_10(2^53) = 15.9546