<commit_before>#!/usr/bin/perl

# Converts transcription phn files to hmmnet files
# Input: PH-file Recipe
# Reads the transcript-files specified in the recipe
# Writes to hmmnet-files specified in the recipe


use Hmm;
use Fsm;
use strict;
use BSD::Resource;

my $eps = ",";

$Hmm::verbose = 0;

my $hmmfile = shift @ARGV;
my $hmms = Hmm::read($hmmfile);

$SIG{PIPE} = 'IGNORE';
setrlimit(RLIMIT_CORE, 0, 0); # Repress core dumps

my $phn_file;
my $hmmnet_file;
my $fh;
my $retry;

while (<>) {
  chomp;
  if (!/transcript=(\S*)/) {
    print "Missing transcript field, skipping...\n";
    next;
  }
  $phn_file = $1;
  if (!/hmmnet=(\S*)/) {
    print "Missing hmmnet field, skipping...\n";
    next;
  }
  $hmmnet_file = $1;
  for ($retry = 0; $retry < 4; $retry++) {<commit_msg>Added path setting for fst-tools<commit_after>#!/usr/bin/perl

# Converts transcription phn files to hmmnet files
# Input: PH-file Recipe
# Reads the transcript-files specified in the recipe
# Writes to hmmnet-files specified in the recipe


use Hmm;
use Fsm;
use strict;
use BSD::Resource;


$ENV{PATH} .= ':/share/puhe/linux/bin'; # Ensure fst-tools are in path

my $eps = ",";

$Hmm::verbose = 0;

my $hmmfile = shift @ARGV;
my $hmms = Hmm::read($hmmfile);

$SIG{PIPE} = 'IGNORE';
setrlimit(RLIMIT_CORE, 0, 0); # Repress core dumps

my $phn_file;
my $hmmnet_file;
my $fh;
my $retry;

while (<>) {
  chomp;
  if (!/transcript=(\S*)/) {
    print "Missing transcript field, skipping...\n";
    next;
  }
  $phn_file = $1;
  if (!/hmmnet=(\S*)/) {
    print "Missing hmmnet field, skipping...\n";
    next;
  }
  $hmmnet_file = $1;
  for ($retry = 0; $retry < 4; $retry++) {
{'fraction_non_alphanumeric': 0.17149758454106281, 'fraction_numerical': 0.008454106280193236, 'mean_word_length': 3.564738292011019, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '7114400', 'n_tokens_mistral': 694, 'n_tokens_neox': 642, 'n_words': 187}