无法生成“cmd.exe”

Yng*_*gve 1 perl cmd

我使用一个名为LF-Aligner的程序,该程序使用字典从不同语言的文本中生成平行文本。我相信它是用 Perl 编写的。它基于另一个名为Hunalign 的程序。

当我几个月前使用它时,它工作得很好。它被意外删除了,我最近重新安装了它,但现在我只收到错误消息:

Aligning...

Dictionary used by Hunalign: es-en.dic

Can't spawn "cmd.exe": No such file or directory at script/LF_aligner_2011_06_29_multi.pl line 1856.
Use of uninitialized value $alignedfilesize in numeric eq (==) at script/LF_aligner_2011_06_29_multi.pl line 1864.

-------------------------------------------------

Align failed (probably due to one file being empty or very short). ABORTING...
Run Code Online (Sandbox Code Playgroud)

我无法理解。这可能与我在此期间安装的东西冲突吗?或者我删除了一些东西,也许?

(问题不是因为“一个文件是空的或很短”,正如程序所建议的那样。文件很好。)

编辑:这是日志文件:

Program: LF aligner, version: 2.56, OS: Windows, launched: 2011/09/28, 04:13:01

Setup: filetype_def: t; filetype_prompt: y; l1_def: en; l2_def: hu; l1_prompt: y; l2_prompt: y; segmenttext_def: y; segmenttext_prompt: y=; cleanup_def: y; cleanup_prompt: y; review_def: x; review_prompt: y; create_tmx_def: y; create_tmx_prompt: y; l1_code_def: EN-GB; l2_code_def: HU; l1_code_prompt: y; l2_code_prompt: y; creationdate_prompt: y; creationid_def: ; creationid_prompt: y; ask_master_TM: n; chopmode: 0; tmxnote_def: ; tmxnote_prompt: y; pdfmode: y

GUI on
filetype: t
Input file 1: kakeen.rtf (C:/Users/jippi/Desktop/qewr/kakeen.rtf)
Input file 2: kaketo.rtf (C:/Users/jippi/Desktop/qewr/kaketo.rtf)
Input file sizes: 1375014 bytes 1375014 bytes
Converting rtf files to txt; AbiWord binary: C:\Program Files (x86)\LF_aligner_2.56\aligner\scripts\abiword\bin\AbiWord.exe
Converting rtf files to txt; AbiWord binary: C:\Program Files (x86)\LF_aligner_2.56\aligner\scripts\abiword\bin\AbiWord.exe
File sizes after conversion to txt: 1074504 bytes 1074504 bytes
Initial stats: 
- en: 6091 segments,    196644 words,   1037434 chars
- en: 6091 segments,    196644 words,   1037434 chars
Segmentation: y
Run Code Online (Sandbox Code Playgroud)

(当我也使用 txt 文件时会出现问题。)

Sin*_*nür 5

我下载了有问题应用程序。它是一个使用pp.

要查看有问题的代码,unzip下载的文件,然后使用提取可执行文件的内容

E:\Home\Downloads\LF_aligner_2.56_win\aligner> unzip LF_aligner_2.56.exe -d some-temp-dir

你会找到文件

some-temp-dir\script\LF_aligner_2011_06_29_multi.pl

第 1856 行是:

system ("\"$hunalign_bin\" -text \"$scriptpath/scripts/hunalign/data/$hunalign_dic\" \"$folder/$file1\" \"$folder/$file2\" > \"$folder/aligned_${alignfilename}.txt\"");

至少可以说这是混乱的。程序不检查是否system成功。由于system失败,随后尝试读取输出文件的大小也失败(注意警告),随后,程序意识到出了点问题:

# SEE IF ALIGNED FILE IS OK, ABORT IF NOT

my $alignedfilesize = -s "$folder/aligned_${alignfilename}.txt";
if ($alignedfilesize == 0) {
    print "\n\n-------------------------------------------------";
    print "\n\nAlign failed (probably due to one file being empty or very short). ABORTING...\n\n";
    print LOG "\nAligned file empty, aborted.";
Run Code Online (Sandbox Code Playgroud)

这些都不能解决您的问题,但是如果您愿意,可以为您提供一些可以调查的东西。至少,您可能想要通知程序的作者。

作者处理路径的方式太混乱了,其他任何人都没有真正有动力去调查。