.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Juman::Sexp 3pm" .TH Juman::Sexp 3pm 2024-04-18 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Juman::Sexp \- S式を読み込むモジュール .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 3 \& use Data::Dumper; \& use Juman::Sexp qw/ parse /; \& print &Dumper( &parse( file => "Noun.dic" ) ); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" \&\f(CW\*(C`Juman::Sexp\*(C'\fR は,Juman 辞書や設定ファイルに用いられているS式を読み込 むための関数 \f(CW\*(C`parse\*(C'\fR を定義している. .SH FUNCTIONS .IX Header "FUNCTIONS" .IP parse 4 .IX Item "parse" 指定された対象を,S式として解析する関数.以下のオプションを受け付ける. .RS 4 .IP "file => FILE" 4 .IX Item "file => FILE" 解析するファイルを指定する. .IP "string => STRING" 4 .IX Item "string => STRING" 解析する文字列を指定する. .IP "comment => STRING" 4 .IX Item "comment => STRING" コメント開始文字列を指定する.コメントをまったく含まない対象を解析する 場合は,以下のように未定義値を指定する. .Sp .Vb 1 \& Example: \& \& &parse( file => "example.dat", comment => undef ); .Ve .IP "debug => BOOLEAN" 4 .IX Item "debug => BOOLEAN" デバッグ用の情報を出力するように指示する. .RE .RS 4 .RE .PP 例えば,文字列を対象として解析する場合は,以下のように指定する. .PP .Vb 1 \& Example: \& \& &parse( string => \& "(名詞 (普通名詞 ((読み かめ)(見出し語 亀 かめ カメ))))" ); .Ve .PP この場合,次のような解析結果が返される. .PP .Vb 7 \& ( [ \*(Aq名詞\*(Aq, \& [ \*(Aq普通名詞\*(Aq, \& [ [ \*(Aq読み\*(Aq, \*(Aqかめ\*(Aq ], \& [ \*(Aq見出し語\*(Aq, \*(Aq亀\*(Aq, \*(Aqかめ\*(Aq, \*(Aqカメ\*(Aq ] \& ] \& ] \& ] ) .Ve .SH AUTHOR .IX Header "AUTHOR" .IP " TSUCHIYA Masatoshi " 4 .IX Item " TSUCHIYA Masatoshi " .SH COPYRIGHT .IX Header "COPYRIGHT" 利用及び再配布については GPL2 または Artistic License に従ってください。 .SH "POD ERRORS" .IX Header "POD ERRORS" Hey! \fBThe above document had some coding errors, which are explained below:\fR .IP "Around line 12:" 4 .IX Item "Around line 12:" Non-ASCII character seen before =encoding in 'S式を読み込むモジュール'. Assuming UTF\-8