diff --git a/scripts/bench/fetch-corpus.ps1 b/scripts/bench/fetch-corpus.ps1 index 0588775..09ff8ba 100644 --- a/scripts/bench/fetch-corpus.ps1 +++ b/scripts/bench/fetch-corpus.ps1 @@ -39,6 +39,9 @@ foreach ($f in $flacs) { $trans = Get-ChildItem -Path $f.DirectoryName -Filter *.trans.txt | Select-Object -First 1 $line = Get-Content $trans.FullName | Where-Object { $_.StartsWith("$name ") } | Select-Object -First 1 if (-not $line) { throw "no reference line for $name" } - Set-Content -Encoding utf8 -NoNewline (Join-Path $corpus "$name.txt") $line.Substring($name.Length + 1) + # Named parameters on purpose: positional binding alongside -NoNewline + # silently wrote nothing under Windows PowerShell 5.1 (found the hard way); + # the WER normalizer doesn't care about a trailing newline. + Set-Content -Path (Join-Path $corpus "$name.txt") -Value $line.Substring($name.Length + 1) -Encoding utf8 } Write-Output "staged $($flacs.Count) utterances in $corpus"