use Moose;
use Moose::Util qw/ does_role apply_all_roles /;
-use Moose::Util::TypeConstraints;
+use Text::Tradition::Datatypes;
use Text::Tradition::Error;
use XML::Easy::Syntax qw( $xml10_name_rx $xml10_namestartchar_rx );
use overload '""' => \&_stringify, 'fallback' => 1;
-subtype 'ReadingID',
- as 'Str',
- where { $_ =~ /\A$xml10_name_rx\z/ },
- message { 'Reading ID must be a valid XML attribute string' };
-
-no Moose::Util::TypeConstraints;
-
# Enable plugin(s) if available
eval { with 'Text::Tradition::Morphology'; };
# Morphology package is not on CPAN, so don't warn of its absence
package Text::Tradition::Collation::Relationship;
use Moose;
-use Moose::Util::TypeConstraints;
-
-enum 'RelationshipScope' => [ qw( local document global ) ];
-
-no Moose::Util::TypeConstraints;
+use Text::Tradition::Datatypes;
=head1 NAME
=item * non_independent - (Optional) True if the variant is unlikely to have
occurred independently in unrelated witnesses.
+=item * is_significant - (Optional) Indicates whether, in the opinion of the scholar,
+the variation in question is stemmatically significant. Possible values are 'yes',
+'maybe', and 'no'.
+
=back
=head1 ACCESSORS
=head2 non_independent
+=head2 is_significant
+
See the option descriptions above.
=cut
isa => 'Bool',
);
+has 'is_significant' => (
+ is => 'ro',
+ isa => 'Ternary',
+ default => 'no',
+ );
+
around 'alters_meaning' => sub {
my $orig = shift;
my $self = shift;
--- /dev/null
+package Text::Tradition::Datatypes;
+
+use Moose::Util::TypeConstraints;
+use XML::Easy::Syntax qw( $xml10_name_rx );
+
+enum 'Ternary' => [ qw( yes maybe no ) ];
+
+enum 'RelationshipScope' => [ qw( local document global ) ];
+
+subtype 'ReadingID',
+ as 'Str',
+ where { $_ =~ /\A$xml10_name_rx\z/ },
+ message { 'Reading ID must be a valid XML attribute string' };
+
+subtype 'SourceType',
+ as 'Str',
+ where { $_ =~ /^(xmldesc|plaintext|json|collation)$/ },
+ message { 'Source type must be one of xmldesc, plaintext, json, collation' };
+
+subtype 'Sigil',
+ as 'Str',
+ where { $_ =~ /\A$xml10_name_rx\z/ },
+ message { 'Sigil must be a valid XML attribute string' };
+
+1;
\ No newline at end of file
use vars qw( %tags );
use JSON;
use Moose;
-use Moose::Util::TypeConstraints;
+use Text::Tradition::Datatypes;
use Text::TEI::Markup qw( word_tag_wrap );
use TryCatch;
-use XML::Easy::Syntax qw( $xml10_name_rx );
=head1 NAME
# Enable plugin(s) if available
eval { with 'Text::Tradition::WitLanguage'; };
-subtype 'SourceType',
- as 'Str',
- where { $_ =~ /^(xmldesc|plaintext|json|collation)$/ },
- message { 'Source type must be one of xmldesc, plaintext, json, collation' };
-
-subtype 'Sigil',
- as 'Str',
- where { $_ =~ /\A$xml10_name_rx\z/ },
- message { 'Sigil must be a valid XML attribute string' };
-
-no Moose::Util::TypeConstraints;
-
has 'tradition' => (
is => 'ro',
isa => 'Text::Tradition',