[Julius-cvs 226] CVS update: julius4/jclient-perl

アーカイブの一覧に戻る

sumom****@users***** sumom****@users*****
2008年 9月 16日 (火) 12:55:48 JST


Index: julius4/jclient-perl/00readme-ja.txt
diff -u /dev/null julius4/jclient-perl/00readme-ja.txt:1.1
--- /dev/null	Tue Sep 16 12:55:48 2008
+++ julius4/jclient-perl/00readme-ja.txt	Tue Sep 16 12:55:48 2008
@@ -0,0 +1,21 @@
+jclient.pl
+============
+
+Julius ‚É•t‘®‚̃Tƒ“ƒvƒ‹ƒNƒ‰ƒCƒAƒ“ƒg "jcontrol" ‚Ì Perl ”Å‚Å‚·D
+ƒ‚ƒWƒ…[ƒ‹iƒT[ƒojƒ‚[ƒh‚Å“®‚­ Julius ‚©‚ç”FŽ¯Œ‹‰Ê‚ðŽó‚¯Žæ‚Á‚½‚èC
+Julius ‚𐧌䂵‚½‚è‚Å‚«‚Ü‚·D
+
+‚킸‚© 57 s‚ÌŠÈ’P‚ȃvƒƒOƒ‰ƒ€‚Å‚·DƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚Ö Julius ‚ð‘g‚ݍž
+‚ލۂ̎Ql‚É‚È‚ê‚΍K‚¢‚Å‚·D‚²Ž©—R‚É‚²—˜—p‚­‚¾‚³‚¢B
+
+---
+
+jclient.pl ‚Í ¼‘º—³ˆê ‚³‚ñ (nisim****@sys*****) ‚É‚æ‚Á‚čì
+¬‚³‚ê‚Ü‚µ‚½D–{ƒvƒƒOƒ‰ƒ€‚Ì‚²—˜—p‚ÉŠÖ‚µ‚ẮCìŽÒ‚͈êØ‚Ì•ÛØ‚ð‚µ‚Ü‚¹
+‚ñDŠeŽ©‚̐ӔC‚Ì‚à‚Æ‚Å‚²—˜—p‚­‚¾‚³‚¢D
+
+Š´‘zAŒäˆÓŒ©AŒä—v–]‚Ȃǂ̃tƒB[ƒhƒoƒbƒN‚ÍŠ½Œ}‚¢‚½‚µ‚Ü‚·‚̂ŁC
+ã‹Lƒ[ƒ‹ƒAƒhƒŒƒXC‚Ü‚½‚͉º‹Lƒz[ƒ€ƒy[ƒW‚ÖŒä˜A—‚­‚¾‚³‚¢D
+
+	http://w3voice.jp/
+
Index: julius4/jclient-perl/00readme.txt
diff -u /dev/null julius4/jclient-perl/00readme.txt:1.1
--- /dev/null	Tue Sep 16 12:55:48 2008
+++ julius4/jclient-perl/00readme.txt	Tue Sep 16 12:55:48 2008
@@ -0,0 +1,19 @@
+jclient.pl
+============
+
+This is a perl version of "jcontrol".
+You can receive recognition result from Julius running in module mode,
+or send command to Julius.
+
+You can use this tiny program for free.
+
+---
+
+"jclient.pl" has been developed by Dr. Ryuichi Nisimura 
+(nisim****@sys*****).  Use at your own risk.
+
+If you have any feedback, comment or request, please contact the
+E-mail address above, or look at the Web page below.
+
+	http://w3voice.jp/
+
Index: julius4/jclient-perl/jclient.pl
diff -u /dev/null julius4/jclient-perl/jclient.pl:1.1
--- /dev/null	Tue Sep 16 12:55:48 2008
+++ julius4/jclient-perl/jclient.pl	Tue Sep 16 12:55:48 2008
@@ -0,0 +1,57 @@
+#! /usr/bin/perl
+use strict;
+use IO::Socket;
+use IO::Select;
+
+my $host = "localhost";
+my $port = 10500;
+
+print STDERR "$host($port) に接続します\n";
+
+# Socketを生成して接続
+my $socket;
+while(!$socket){
+    $socket = IO::Socket::INET->new(PeerAddr => $host,
+                                    PeerPort => $port,
+                                    Proto    => 'tcp',
+                                    );
+    if (!$socket){
+        printf STDERR "$host($port) の接続に失敗しました\n";
+        printf STDERR "再接続を試みます\n";
+        sleep 10;
+    }
+}
+
+print STDERR "$host($port) に接続しました\n";
+
+# バッファリングをしない
+$| = 1;
+my($old) = select($socket); $| = 1; select($old);
+
+# Selecterを生成
+my $selecter = IO::Select->new;
+$selecter->add($socket);
+$selecter->add(\*STDIN);
+
+# 入力待ち
+while(1){
+    my ($active_socks) = IO::Select->select($selecter, undef, undef, undef);
+
+    foreach my $sock (@{$active_socks}){
+        # Juliusからの出力を表示
+        if ($sock == $socket){
+            while(<$socket>){
+                print;
+                last if(/^\./);
+            }
+	    # 標準入力をJuliusに送信
+        }else{
+            my $input = <STDIN>;
+            # 小文字を大文字に変換
+            $input =~ tr/a-z/A-Z/d;
+
+            print $socket $input;
+        }
+    }
+}       
+


Julius-cvs メーリングリストの案内
アーカイブの一覧に戻る