<commit_before>#!/usr/bin/perl
use strict;
use warnings;
use FindBin '$Bin';
use Test::More 'no_plan';

use_ok ( 'Bio::BioVeL::Service::NeXMLExtractor' );

# extract trees in nexus format
my $nexml = "$Bin/../Examples/treebase-record.xml";

@ARGV = (
    '-nexml'      => $nexml,
    '-object'     => 'Trees',
    '-treeformat' => 'newick',
    '-dataformat' => 'nexus'
);

my $extractor = new_ok ('Bio::BioVeL::Service::NeXMLExtractor');

ok( my $res = $extractor->response_body );

# extract charset data in nexus format
$nexml = "$Bin/../Examples/merge.xml";

@ARGV = (
    '-nexml'      => $nexml,
    '-object'     => 'Charset',
    '-dataformat' => 'nexus'
);

$extractor = new_ok ('Bio::BioVeL::Service::NeXMLExtractor');
ok( my $res = $extractor->response_body );<commit_msg>added testing for charset extraction<commit_after>#!/usr/bin/perl
use strict;
use warnings;
use FindBin '$Bin';
use Test::More 'no_plan';

use_ok ( 'Bio::BioVeL::Service::NeXMLExtractor' );

# extract trees in nexus format
my $nexml = "$Bin/../Examples/treebase-record.xml";

@ARGV = (
    '-nexml'      => $nexml,
    '-object'     => 'Trees',
    '-treeformat' => 'newick',
    '-dataformat' => 'nexus'
);

my $extractor = new_ok ('Bio::BioVeL::Service::NeXMLExtractor');

ok( my $res = $extractor->response_body );

# extract charset data in nexus format
$nexml = "$Bin/../Examples/merge.xml";

@ARGV = (
    '-nexml'      => $nexml,
    '-object'     => 'Charset',
    '-dataformat' => 'nexus'
);

$extractor = new_ok ('Bio::BioVeL::Service::NeXMLExtractor');
ok( $res = $extractor->response_body );
{'fraction_non_alphanumeric': 0.2030264817150063, 'fraction_numerical': 0.0, 'mean_word_length': 3.809090909090909, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2522491', 'n_tokens_mistral': 616, 'n_tokens_neox': 587, 'n_words': 123}