-
-
Save samth/44a29fb1b746f7d77385 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(define hangul-data-file "src/racket-unihan/Unihan_Readings.txt") | |
(define-values (_ r) (call-with-input-file hangul-data-file | |
(lambda (in) | |
(for/lists (lines) ([l (in-lines in)] | |
#:unless (eq? '#\# (string-ref l 0)) | |
#:break (= (length lines) 30)) | |
l)))) | |
(define-values (_ r2) (call-with-input-file hangul-data-file | |
(lambda (in) | |
(let loop ([c 0]) | |
(define l (read-line in)) | |
(if (= c 30) | |
null | |
(if (eq? '#\# (string-ref l 0)) | |
(loop c) | |
(cons l (loop (add1 c))))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment