{"id":22783805,"url":"https://github.com/greg-kennedy/markovchain","last_synced_at":"2025-07-26T07:37:11.067Z","repository":{"id":86779631,"uuid":"47425968","full_name":"greg-kennedy/MarkovChain","owner":"greg-kennedy","description":"A Markov Chain class for text manipulation, in Perl.","archived":false,"fork":false,"pushed_at":"2020-08-01T03:44:55.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T16:47:48.347Z","etag":null,"topics":["generative-text","markov","markov-chain","perl","perl-module","perl5"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greg-kennedy.png","metadata":{"files":{"readme":"README.pod","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-04T19:59:56.000Z","updated_at":"2020-08-01T03:44:57.000Z","dependencies_parsed_at":"2023-07-12T07:30:28.153Z","dependency_job_id":null,"html_url":"https://github.com/greg-kennedy/MarkovChain","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greg-kennedy%2FMarkovChain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greg-kennedy%2FMarkovChain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greg-kennedy%2FMarkovChain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greg-kennedy%2FMarkovChain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greg-kennedy","download_url":"https://codeload.github.com/greg-kennedy/MarkovChain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246334456,"owners_count":20760646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generative-text","markov","markov-chain","perl","perl-module","perl5"],"created_at":"2024-12-11T22:09:30.605Z","updated_at":"2025-03-30T15:16:49.712Z","avatar_url":"https://github.com/greg-kennedy.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"=pod\n\n=head1 NAME\n\nMarkovChain - A module using a non-weighted Markov Chain for text manipulation.\n\n=head1 SYNOPSIS\n\n    use MarkovChain;\n    my $chain = MarkovChain-\u003enew($order, $limit);\n    $chain-\u003eadd(\"some string\", @list_of_more_strings);\n    print $chain-\u003espew;\n\n=head1 DESCRIPTION\n\nThis module creates new sentences from a list of input strings.  After the\nmodule creation, you should seed the generator with one or more sentences.\nCalling the spew method will print a new sentence composed of words from\nthe previous.\n\n=head2 Methods\n\n=item C\u003cnew\u003e\n\nReturns a new MarkovChain object.\n\nThe first parameter to this object sets the \"order\", or\nlength of sub-phrases to use for generation.  Higher order\nleads to more of the input text being preserved, but\nalso more coherent output.  Lower is more chaotic.\nDefaults to 3.\n\nThe second parameter, \"limit\", sets a maximum length\nof the output chain.  When the limit is reached, the sentence\nis terminated.  This is primarily used to avoid infinite loops.\nDefaults to 50.\n\n=item C\u003cadd\u003e\n\nAdds one or more strings to the class.  This has two effects:\nthe first words of the string are added to the \"sentence\nbeginnings\" list.  These are randomly chosen to use later.\nSecond, the sentence is parsed into phrases.  Each phrase\nis stored with a follow-up word, and are used to form the output.\n\nInput strings are somewhat normalized for consistency, by removing\nall non-word non-space characters, before usage as lookup keys.\nThis helps tokens find more possible matches.  Outputs are not\nnormalized, however, so users may wish to remove problematic characters\nsuch as quotes or parentheses first.\n\nReturns the number of sentences successfully added.\n\n=item C\u003cspew\u003e\n\nReturns a new string, composed randomly from the phrases\ncurrently added to the class.\n\n=head1 LICENSE\n\nThis is released under the Artistic License. See L\u003cperlartistic\u003e.\n\n=head1 AUTHOR\n\nGreg Kennedy - L\u003chttp://greg-kennedy.com/\u003e\n\n=head1 SEE ALSO\n\nL\u003chttps://en.wikipedia.org/wiki/Markov_chain#Markov_text_generators\u003e\n\n=cut\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreg-kennedy%2Fmarkovchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreg-kennedy%2Fmarkovchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreg-kennedy%2Fmarkovchain/lists"}