This file contains hidden or 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
#!/bin/sh | |
mecab --node-format="%f[7] " | nkf -w --hiragana | sed 's/EOS//g' |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# Usage: ruby detect_rhyme.rb /path/to/file.txt num | |
# Example: ruby detect_rhyme.rb 坊ちゃん.txt 3 | |
require 'MeCab' | |
def main(args) | |
path, num = args[0], args[1].to_i | |
rhyme = {} | |
File.open(path).each do |line| | |
node_list = get_node_list(line) |
NewerOlder