| Filename | /mnt/stuff/src/my-cpan/hailo/lib/Hailo/Role/Engine.pm |
| Statements | Executed 13 statements in 212µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 58µs | 140µs | Hailo::Role::Engine::BEGIN@3 |
| 1 | 1 | 1 | 15µs | 1.42ms | Hailo::Role::Engine::BEGIN@5 |
| 1 | 1 | 1 | 12µs | 82µs | Hailo::Role::Engine::BEGIN@3.17 |
| 1 | 1 | 1 | 12µs | 421µs | Hailo::Role::Engine::BEGIN@4 |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Hailo::Role::Engine; | ||||
| 2 | |||||
| 3 | 4 | 78µs | 3 | 292µs | use 5.010; # spent 140µs making 1 call to Hailo::Role::Engine::BEGIN@3
# spent 82µs making 1 call to Hailo::Role::Engine::BEGIN@3.17
# spent 70µs making 1 call to feature::import |
| 4 | 2 | 31µs | 2 | 830µs | # spent 421µs (12+409) within Hailo::Role::Engine::BEGIN@4 which was called:
# once (12µs+409µs) by Mouse::Util::_try_load_one_class at line 4 # spent 421µs making 1 call to Hailo::Role::Engine::BEGIN@4
# spent 409µs making 1 call to Any::Moose::import |
| 5 | 2 | 74µs | 2 | 2.82ms | # spent 1.42ms (15µs+1.40) within Hailo::Role::Engine::BEGIN@5 which was called:
# once (15µs+1.40ms) by Mouse::Util::_try_load_one_class at line 5 # spent 1.42ms making 1 call to Hailo::Role::Engine::BEGIN@5
# spent 1.40ms making 1 call to namespace::clean::import |
| 6 | |||||
| 7 | 1 | 5µs | 1 | 41µs | has storage => ( # spent 41µs making 1 call to Mouse::Role::has |
| 8 | required => 1, | ||||
| 9 | is => 'ro', | ||||
| 10 | documentation => "Our copy of the current Storage object", | ||||
| 11 | ); | ||||
| 12 | |||||
| 13 | 1 | 4µs | 1 | 31µs | has order => ( # spent 31µs making 1 call to Mouse::Role::has |
| 14 | required => 1, | ||||
| 15 | isa => 'Int', | ||||
| 16 | is => 'rw', | ||||
| 17 | documentation => "Our copy of the current markov order", | ||||
| 18 | ); | ||||
| 19 | |||||
| 20 | 1 | 4µs | 1 | 66µs | requires 'learn'; # spent 66µs making 1 call to Mouse::Role::requires |
| 21 | 1 | 3µs | 1 | 51µs | requires 'reply'; # spent 51µs making 1 call to Mouse::Role::requires |
| 22 | |||||
| 23 | 1 | 7µs | 1; | ||
| 24 | |||||
| 25 | =encoding utf8 | ||||
| 26 | |||||
| 27 | =head1 NAME | ||||
| 28 | |||||
| 29 | Hailo::Role::Engine - A role representing a L<Hailo|Hailo> engine backend | ||||
| 30 | |||||
| 31 | =head1 ATTRIBUTES | ||||
| 32 | |||||
| 33 | A C<Hailo::Engine::*> gets the following attributes by using this role: | ||||
| 34 | |||||
| 35 | =head2 C<storage> | ||||
| 36 | |||||
| 37 | A L<storage|Hailo::Role::Storage> object the engine should use to get data from. | ||||
| 38 | |||||
| 39 | =head2 C<order> | ||||
| 40 | |||||
| 41 | The current Markov order used by the storage object. | ||||
| 42 | |||||
| 43 | =head1 METHODS | ||||
| 44 | |||||
| 45 | =head2 C<new> | ||||
| 46 | |||||
| 47 | This is the constructor. It accept the attributes specified in | ||||
| 48 | L</ATTRIBUTES>. | ||||
| 49 | |||||
| 50 | =head2 C<learn> | ||||
| 51 | |||||
| 52 | Learn from the given input and add it to storage. | ||||
| 53 | |||||
| 54 | =head2 C<reply> | ||||
| 55 | |||||
| 56 | Reply to the given input using the storad data. | ||||
| 57 | |||||
| 58 | =head1 AUTHOR | ||||
| 59 | |||||
| 60 | E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason <avar@cpan.org> | ||||
| 61 | |||||
| 62 | =head1 LICENSE AND COPYRIGHT | ||||
| 63 | |||||
| 64 | Copyright 2010 E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason. | ||||
| 65 | |||||
| 66 | This program is free software, you can redistribute it and/or modify | ||||
| 67 | it under the same terms as Perl itself. | ||||
| 68 | |||||
| 69 | 1 | 8µs | 1 | 4.39ms | =cut # spent 4.39ms making 1 call to B::Hooks::EndOfScope::__ANON__[B/Hooks/EndOfScope.pm:26] |