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

Version Path
sekka-1.8.0 data/writing_phrase_filter.nnd
sekka-1.7.1 data/writing_phrase_filter.nnd
sekka-1.7.0 data/writing_phrase_filter.nnd
sekka-1.6.6 data/writing_phrase_filter.nnd
sekka-1.6.5 data/writing_phrase_filter.nnd
sekka-1.6.4 data/writing_phrase_filter.nnd
sekka-1.6.3 data/writing_phrase_filter.nnd
sekka-1.6.2 data/writing_phrase_filter.nnd
sekka-1.6.1 data/writing_phrase_filter.nnd
sekka-1.6.0 data/writing_phrase_filter.nnd
sekka-1.5.9 data/writing_phrase_filter.nnd
sekka-1.5.8 data/writing_phrase_filter.nnd
sekka-1.5.7 data/writing_phrase_filter.nnd