Sha256: 75c07544d6e62550b16042b3b453c6c28cc14648bc77f78e1ee9a94fd2be47e3
Contents?: true
Size: 808 Bytes
Versions: 13
Compression:
Stored size: 808 Bytes
Contents
#!/bin/sh :; #-*- mode: nendo; syntax: scheme -*-;; :; exec /usr/local/bin/nendo $0 $* (define (writing-phrase? str) (not (or (rxmatch #/ー/ str) (rxmatch #/[ぁぃぅぇぉゃゅょっー]$/ str)))) (define (writing-phrase-filter filename) (with-open filename (lambda (f) (for-each (lambda (line) (let* ([lst (to-list (line.chomp.split #/[ \t]+/))] [word (car lst)]) (when (and (<= 2 (word.size)) (<= (word.size) 7) (writing-phrase? word)) (printf "%s //\n" word)))) (f.readlines.to_list))))) (define (main argv) (if (> 1 (length argv)) (error "writing_phrase_filter.nnd requires file as 'hiragana ;; ....' ") (writing-phrase-filter (car (to-list argv)))))
Version data entries
13 entries across 13 versions & 1 rubygems