[](https://travis-ci.org/dayflower/p5-Text-Lorem-JA) # NAME Text::Lorem::JA - Japanese Lorem Ipsum generator # SYNOPSIS use Text::Lorem::JA; # Generated text are represented in Perl internal format (Unicode). binmode \*STDOUT, ':encoding(UTF-8)'; my $lorem = Text::Lorem::JA->new(); # Generate a string of text with 10 characters. print $lorem->word(10), "\n"; # => 好ããªå¼·ã¿ã¨ã‚’考ãˆã¦ # Generate a string of text with 10 tokens. print $lorem->words(10), "\n"; # => 主è¦ãªç´ 質ã«ã—ã°ã—ã°ã‚ã‚‹ã¾ã„ã¾ã§ã¯ã£ãã‚Šã¤ã‹ã¾ãˆã‚‹ # Generate a string of text with 3 sentences. # Invoking via class methods are also allowed. print Text::Lorem::JA->sentences(3), "\n"; # => ã„ã¡ã°ã‚“é¢ç™½ã„ã„ã„方をã¯ã£ãã‚Šã•ã›ãªã„会社ãŒã‚ã£ã¦ã‚‚〠# ã‚„ãŒã¦ã‹ã‚ã£ã¦ã€è¨±ã•ã‚Œãªã„。人物ã®ç”Ÿãã¦ã„ã‚‹ã€ã»ã“り〠# å“ä½ã®ã‚らã‚ã‚Œã§ã‚る。文明社会ã¯ã€æ£ã—ããã†ã„ã†ç«‹å ´ã« # ã„ãªãŒã‚‰ã€æ±‚ã‚ã¦ä¸€å¡Šã®å²©ç¤ã«è† ç€ã—ã¦ã¿ã‚‹ã€‚ # DESCRIPTION Text::Lorem::JA generates fake Japanese text via Markov chain. # METHODS Most of instance methods can be called as class methods. Generated strings are in Perl's internal format (Unicode). - `new` $lorem = Text::Lorem::JA->new(); $lorem = Text::Lorem::JA->new( dictionary => ..., chains => ... ); Creates a new Text::Lorem::JA generator object. Can specify dictionary file and chains for generating sentences. - `word` $word = $lorem->word($length); Returns a exact given `$length` string. Argument length represents number of Unicode characters. Not bytes. - `words` $words = $lorem->words($number_of_morphems); Generates a string composed from morphemes of given number. At Japanese language, words are not delimited by whitespaces in normal style. - `sentence` $sentence = $lorem->sentence(); Generates a single sentence. - `sentences` $sentences = $lorem->sentences($number_of_sentences); Generates sentences. # TOOL You can use [lorem\_ja](http://search.cpan.org/perldoc?lorem\_ja) executable for generating Japanese Lorem text from CLI. # LICENSE Copyright (C) ITO Nobuaki. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. # AUTHOR ITO Nobuaki <dayflower@cpan.org>