| 1 | package Langertha::Role::ContextSize; | ||||||||||
| 2 | # ABSTRACT: Role for an engine where you can specify the context size (in tokens) | ||||||||||
| 3 | 58 | our $VERSION = '0.505'; | |||||||||
| 4 | 58 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 58 | has context_size => ( | |||||||||
| 7 | isa => 'Int', | ||||||||||
| 8 | is => 'ro', | ||||||||||
| 9 | predicate => 'has_context_size', | ||||||||||
| 10 | ); | ||||||||||
| 11 | |||||||||||
| 12 | |||||||||||
| 13 | 2 | ▶ | sub get_context_size { | ||||||||
|
Subroutine
get_context_size: called CC=3 SCAR=16.5
Pod
documented
| |||||||||||
| 14 | 2 | my ( $self ) = @_; | |||||||||
| 15 | 2 | ▶ | return $self->context_size if $self->has_context_size; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 0 | ▶ | return $self->default_context_size if $self->can('default_context_size'); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 0 | return; | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | |||||||||||
| 21 | |||||||||||
| 22 | 58 | 1; | |||||||||
| 23 | |||||||||||
| 24 | __END__ | ||||||||||