ziness, $language ) = ( 25, 50, 'Default' );
my( $CSV, $storable, $outfile, $infile, $text, $cx, $json, $debug, %argspec );
GetOptions( 'csv' => \$CSV,
'width=i' => \$col_width,
'storable'
s' => \$outfile,
'store=s' => \$infile,
'text' => \$text,
'cx' => \$cx,
'json' => \$json,
'debug:i' => \$debug,
'argspec=s' => \%argspec,
'fuzziness=i' => \$fuzzines
', 'sliding' => 0, 'inclusive' => 0 );
}
## Get busy.
my( @files ) = @ARGV;
if( $json ) { # The 'file' is the JSON string.
my @lines;
while( <> ) {
push( @lines, $_ );
}
@files = (
pe 'SourceType',
as 'Str',
where { $_ =~ /^(xmldesc|plaintext|json)$/ },
message { 'Source type must be one of xmldes, plaintext, json' };
subtype 'Sigil',
as 'Str',
where { $_ =~ /\A$xml10_nam
=> 'ro',
isa => 'Str',
default => 'Default',
);
has 'source' => ( # Can be XML obj, JSON data struct, or string.
is => 'ro',
required => 1,
);
has 'msdesc' => ( # if we started with
( length( $w_obj->word ) == 0 );
push( @words, $w_obj );
}
return @words;
}
sub _init_from_json {
my( $self, $wit ) = @_;
$self->sigil( $wit->{'id'} );
$self->identifier( $wit->{'name'} );
string - the initial word string that should be parsed into its forms
=item *
json - a hash, presumably read from JSON, that has all the attributes
=item *
empty - a flag to say that this should b
ok( !$word->is_empty, "Word is not empty");
# Initialize a word from a JSON string, check its values
use JSON qw( decode_json );
my $jstring = encode_utf8( '{"c":"Արդ","n":"արդ","punctuation":
"Առդ"}' );
$word = Text::TEI::Collate::Word->new( json => decode_json($jstring), ms_sigil => 'B' );
is( $word->word, 'Առդ', "Got correct JSON word before modification" );
is( $word->canonical_fo
de qw( decode_utf8 );
use File::Temp;
use Graph::Easy;
use IPC::Run qw( run binary );
use JSON qw( decode_json );
use Module::Load;
use Text::CSV_XS;
use Text::TEI::Collate::Diff;
use Text::TEI::Colla
( $xml_file ) )
}
$aligner->align( @manuscripts );
# Read from a JSON input.
@manuscripts = $aligner->read_source( $JSON_string );
$aligner->align( @manuscripts );
=head1 DESCRIPTION
Te
ay title for the collation output results, should those
results need a display title (e.g. TEI or JSON output).
=item B<language> - Specify the language module we should use from those
available in T