Skip to content

Instantly share code, notes, and snippets.

@kurain
Created December 11, 2011 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurain/1458407 to your computer and use it in GitHub Desktop.
Save kurain/1458407 to your computer and use it in GitHub Desktop.
speak_stdin
#!/usr/bin/env perl
use warnings;
use strict;
use Text::MeCab;
my $mecab = Text::MeCab->new;
while(<>){
chomp;
my $text;
for (my $node = $mecab->parse($_); $node; $node = $node->next) {
my @f = split ',', $node->feature;
warn $node->feature;
$text .= $f[8] if $f[8] ne '*';
}
system "/usr/local/bin/SayKana $text";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment