Index: trunk/apertium/apertium/align.cc
===================================================================
--- trunk/apertium/apertium/align.cc (revision 69687)
+++ trunk/apertium/apertium/align.cc (revision 69688)
@@ -14,8 +14,8 @@
// along with this program; if not, see .
#include "align.h"
-
#include "linebreak.h"
+#include
#include
#include
@@ -33,7 +33,7 @@
for (std::vector >::const_iterator i_ =
string_.begin();
i_ != string_.end(); ++i_) {
- std::cerr << " " << std::setw(width_) << std::left << i_->first
+ std::wcerr << " " << std::setw(width_) << std::left << i_->first
<< std::setw(0)
<< linebreak::linebreak_(i_->second, width_ + 2, width_ + 4)
<< '\n';
Index: trunk/apertium/apertium/apertium-prelatex.l
===================================================================
--- trunk/apertium/apertium/apertium-prelatex.l (revision 69687)
+++ trunk/apertium/apertium/apertium-prelatex.l (revision 69688)
@@ -10,6 +10,7 @@
#include
#include
#include
+#include
extern "C" {
#if !defined(__STDC__)
@@ -420,9 +421,9 @@
void usage(string const &progname)
{
- cerr << "USAGE: " << progname << " [input_file [output_file]" << ']' << endl;
+ wcerr << "USAGE: " << progname << " [input_file [output_file]" << ']' << endl;
- cerr << "LaTeX format preprocessor " << endl;
+ wcerr << "LaTeX format preprocessor " << endl;
exit(EXIT_SUCCESS);
}
Index: trunk/apertium/apertium/apertium_filter_ambiguity.cc
===================================================================
--- trunk/apertium/apertium/apertium_filter_ambiguity.cc (revision 69687)
+++ trunk/apertium/apertium/apertium_filter_ambiguity.cc (revision 69688)
@@ -43,7 +43,7 @@
struct stat var;
if(stat(filename, &var))
{
- cerr << "Can't stat '" << filename << "'" << endl;
+ wcerr << "Can't stat '" << filename << "'" << endl;
exit(EXIT_FAILURE);
}
@@ -51,7 +51,7 @@
if(!retval)
{
- cerr << "Can't open '" << filename << "'" << endl;
+ wcerr << "Can't open '" << filename << "'" << endl;
exit(EXIT_FAILURE);
}
#ifdef _MSC_VER
@@ -67,7 +67,7 @@
if(argc < 2 || argc > 4)
{
- cerr << "USAGE: " << basename(argv[0]) << " tsx_file [input [output]" << endl;
+ wcerr << "USAGE: " << basename(argv[0]) << " tsx_file [input [output]" << endl;
exit(EXIT_FAILURE);
}
Index: trunk/apertium/apertium/apertium_interchunk.cc
===================================================================
--- trunk/apertium/apertium/apertium_interchunk.cc (revision 69687)
+++ trunk/apertium/apertium/apertium_interchunk.cc (revision 69688)
@@ -36,14 +36,14 @@
void message(char *progname)
{
- cerr << "USAGE: " << basename(progname) << " [-tz] t2x preproc [input [output]]" << endl;
- cerr << " t2x t2x rules file" << endl;
- cerr << " preproc result of preprocess trules file" << endl;
- cerr << " input input file, standard input by default" << endl;
- cerr << " output output file, standard output by default" << endl;
- cerr << "OPTIONS" <"));
align::align_(options_description_);
- std::cerr << '\n';
+ std::wcerr << '\n';
options_description_.clear();
options_description_.push_back(std::make_pair("-w, --sliding-window", "use the Light Sliding Window algorithm"));
align::align_(options_description_);
- std::cerr << '\n';
+ std::wcerr << '\n';
options_description_.clear();
options_description_.push_back(std::make_pair("-g, --tagger", "disambiguate the input"));
align::align_(options_description_);
- std::cerr << '\n';
+ std::wcerr << '\n';
options_description_.clear();
options_description_.push_back(std::make_pair("-r, --retrain=ITERATIONS", "with -u: exit;\notherwise: retrain the tagger with ITERATIONS unsupervised iterations"));
options_description_.push_back(std::make_pair("-s, --supervised=ITERATIONS", "with -u: train the tagger with a hand-tagged corpus;\nwith -w: exit;\notherwise: initialise the tagger with a hand-tagged corpus and retrain it with ITERATIONS unsupervised iterations"));
options_description_.push_back(std::make_pair("-t, --train=ITERATIONS", "with -u: exit;\notherwise: train the tagger with ITERATIONS unsupervised iterations"));
align::align_(options_description_);
- std::cerr << '\n';
+ std::wcerr << '\n';
options_description_.clear();
options_description_.push_back(std::make_pair("-h, --help", "display this help and exit"));
align::align_(options_description_);
@@ -679,8 +679,8 @@
FILE_Tagger_.read_dictionary(Dictionary);
try_close_file("DICTIONARY", argv[optind], Dictionary);
- FILE *TaggedCorpus = try_open_file_utf8("TAGGED_CORPUS", argv[optind + 4], "r");
- FILE *UntaggedCorpus = try_open_file_utf8("UNTAGGED_CORPUS", argv[optind + 5], "r");
+ FILE *TaggedCorpus = try_open_file("TAGGED_CORPUS", argv[optind + 4], "r");
+ FILE *UntaggedCorpus = try_open_file("UNTAGGED_CORPUS", argv[optind + 5], "r");
FILE_Tagger_.init_probabilities_from_tagged_text_(TaggedCorpus,
UntaggedCorpus);
try_close_file("TAGGED_CORPUS", argv[optind + 4], TaggedCorpus);
@@ -729,7 +729,7 @@
try {
apertium_tagger(argc, argv);
} catch (const err_Exception &err_Exception_) {
- std::cerr << "Try 'apertium-tagger --help' for more information.\n";
+ std::wcerr << "Try 'apertium-tagger --help' for more information." << std::endl;
return 1;
} catch (...) {
throw;
Index: trunk/apertium/apertium/apertium_tagger_apply_new_rules.cc
===================================================================
--- trunk/apertium/apertium/apertium_tagger_apply_new_rules.cc (revision 69687)
+++ trunk/apertium/apertium/apertium_tagger_apply_new_rules.cc (revision 69688)
@@ -22,6 +22,7 @@
#include
#include
#include "getopt_long.h"
+#include
#include
#include
@@ -38,17 +39,17 @@
void check_file(FILE *f, const string& path) {
if (!f) {
- cerr<<"Error: cannot open file '"<get_tags()];
if ((k>=tagger_data_hmm.getM())||(k<0)) {
- cerr<<"Error: Ambiguity class number out of range: "<get_superficial_form())<<"\n";
- cerr<<"Ambiguity class: "<get_string_tags())<<"\n";
+ wcerr<<"Error: Ambiguity class number out of range: "<get_superficial_form())<<"\n";
+ wcerr<<"Ambiguity class: "<get_string_tags())<<"\n";
}
}
@@ -77,15 +77,15 @@
word=lexmorfo.get_next_word();
}
- cerr<] < file.crp \n\n";
+ wcerr<<"USAGE:\n";
+ wcerr<] < file.crp \n\n";
- cerr<<"ARGUMENTS: \n"
+ wcerr<<"ARGUMENTS: \n"
<<" --tsxfile|-x: Specify a tagger specification file\n"
<<" --probfile|-p: Specify a tagger parameter file\n"
<<" --clength|-l: Specify the length of the corpus to process\n";
@@ -100,12 +100,12 @@
int c;
int option_index=0;
- cerr<<"LOCALE: "<
", REG_EXTENDED))
{
- cerr << "ERROR: Illegal regular expression for escape characters" << endl;
+ wcerr << "ERROR: Illegal regular expression for escape characters" << endl;
exit(EXIT_FAILURE);
}
}
@@ -234,7 +235,7 @@
", REG_EXTENDED))
{
- cerr << "ERROR: Illegal regular expression for tag-names" << endl;
+ wcerr << "ERROR: Illegal regular expression for tag-names" << endl;
exit(EXIT_FAILURE);
}
}
@@ -742,13 +743,13 @@
{
- cerr << "USAGE: " << progname << " format_file [input_file [output_file]" << ']' << endl;
+ wcerr << "USAGE: " << progname << " format_file [input_file [output_file]" << ']' << endl;
- cerr << "USAGE: " << progname << " [ -h | -i | -n ] [input_file [output_file]" << ']' << endl;
+ wcerr << "USAGE: " << progname << " [ -h | -i | -n ] [input_file [output_file]" << ']' << endl;
- cerr << " format processor " << endl;
+ wcerr << " format processor " << endl;
exit(EXIT_SUCCESS);
}
Index: trunk/apertium/apertium/hmm.cc
===================================================================
--- trunk/apertium/apertium/hmm.cc (revision 69687)
+++ trunk/apertium/apertium/hmm.cc (revision 69688)
@@ -539,15 +539,15 @@
i=*itag;
for (jtag=pretags.begin(); jtag!=pretags.end(); jtag++) {
j=*jtag;
- //cerr<<"previous alpha["<1) {
@@ -559,8 +559,8 @@
prob = alpha[len][tag];
- //cerr<<"prob="<name << "'" << endl;
+ wcerr << "Error: unexpected rvalue expression '" << element->name << "'" << endl;
exit(EXIT_FAILURE);
}
@@ -1495,7 +1495,7 @@
break;
default:
- cerr << "Error: Unknown input token." << endl;
+ wcerr << "Error: Unknown input token." << endl;
return;
}
}
Index: trunk/apertium/apertium/lextor_data.cc
===================================================================
--- trunk/apertium/apertium/lextor_data.cc (revision 69687)
+++ trunk/apertium/apertium/lextor_data.cc (revision 69688)
@@ -110,33 +110,33 @@
void
LexTorData::read(FILE *is) {
- //cerr<<"LexTorData::read------------------------------------\n";
+ //wcerr<<"LexTorData::read------------------------------------\n";
n_stopwords=(WORD_DATA_TYPE)Compression::multibyte_read(is);
n_words=(WORD_DATA_TYPE)Compression::multibyte_read(is);
n_words_per_set=(WORD_DATA_TYPE)Compression::multibyte_read(is);
n_set=(WORD_DATA_TYPE)Compression::multibyte_read(is);
- //cerr<::iterator it;
for (it=stopwords.begin(); it!=stopwords.end(); it++) {
Compression::wstring_write(*it, os);
@@ -201,7 +201,7 @@
}
//Write the list of words
- //cerr<<"list of words----------------------------------------\n";
+ //wcerr<<"list of words----------------------------------------\n";
for(unsigned int i=1; i (&prob), sizeof(double));
EndianDoubleUtil::write(os, sum);
@@ -228,7 +228,7 @@
it_w_lch_set++) {
WORD_DATA_TYPE word=it_w_lch_set->first;
COUNT_DATA_TYPE count=it_w_lch_set->second;
- //cerr<<" word: "<find(*its)==0) {
wcerr<name << "'" << endl;
+ wcerr << "Error: unexpected rvalue expression '" << element->name << "'" << endl;
exit(EXIT_FAILURE);
}
@@ -1627,7 +1627,7 @@
break;
default:
- cerr << "Error: Unknown input token." << endl;
+ wcerr << "Error: Unknown input token." << endl;
return;
}
}
Index: trunk/apertium/apertium/reformat.xsl
===================================================================
--- trunk/apertium/apertium/reformat.xsl (revision 69687)
+++ trunk/apertium/apertium/reformat.xsl (revision 69688)
@@ -36,6 +36,7 @@
#include <unistd.h>
#include <lttoolbox/lt_locale.h>
#include <lttoolbox/ltstr.h>
+#include <apertium/string_utils.h>
#include <wchar.h>
#ifdef _WIN32
#include <io.h>
@@ -123,7 +124,7 @@
if(!temp)
{
- cerr << "ERROR: File '" << filename <<"' not found." << endl;
+ wcerr << "ERROR: File '" << filename <<"' not found." << endl;
exit(EXIT_FAILURE);
}
while(static_cast<int>(mychar = fgetwc_unlocked(temp)) != EOF)
@@ -186,8 +187,8 @@
void usage(string const &progname)
{
- cerr << "USAGE: " << progname << " [input_file [output_file]" << ']' << endl;
- cerr << " format processor " << endl;
+ wcerr << "USAGE: " << progname << " [input_file [output_file]" << ']' << endl;
+ wcerr << " format processor " << endl;
exit(EXIT_SUCCESS);
}
Index: trunk/apertium/apertium/string_utils.cc
===================================================================
--- trunk/apertium/apertium/string_utils.cc (revision 69687)
+++ trunk/apertium/apertium/string_utils.cc (revision 69688)
@@ -20,6 +20,7 @@
#include
#include
#include
+#include
#ifdef _MSC_VER
#define snprintf _snprintf
@@ -181,3 +182,10 @@
{
return strcmp(s1, s2.c_str()) != 0;
}
+
+std::wostream & operator<<(std::wostream & ostr, std::string const & str) {
+ std::copy(
+ str.begin(), str.end(),
+ std::ostream_iterator(ostr));
+ return ostr;
+}
Index: trunk/apertium/apertium/string_utils.h
===================================================================
--- trunk/apertium/apertium/string_utils.h (revision 69687)
+++ trunk/apertium/apertium/string_utils.h (revision 69688)
@@ -57,4 +57,6 @@
static wstring toupper(wstring const &s);
};
+std::wostream & operator<< (std::wostream & ostr, std::string const & str);
+
#endif
Index: trunk/apertium/apertium/tagger_utils.cc
===================================================================
--- trunk/apertium/apertium/tagger_utils.cc (revision 69687)
+++ trunk/apertium/apertium/tagger_utils.cc (revision 69688)
@@ -43,7 +43,7 @@
}
void tagger_utils::file_name_error (string const &s) {
- cerr << "Error: " << s << endl;
+ wcerr << "Error: " << s << endl;
exit(1);
}
Index: trunk/apertium/apertium/tmx_aligner_tool.cc
===================================================================
--- trunk/apertium/apertium/tmx_aligner_tool.cc (revision 69687)
+++ trunk/apertium/apertium/tmx_aligner_tool.cc (revision 69688)
@@ -10,6 +10,7 @@
* *
*************************************************************************/
#include
+#include
namespace TMXAligner
{
@@ -27,7 +28,7 @@
is >> huPos;
if (is.peek()!=' ')
{
- std::cerr << "no space in line" << std::endl;
+ std::wcerr << "no space in line" << std::endl;
throw "data error";
}
is.ignore();
@@ -35,7 +36,7 @@
is >> enPos;
if (is.peek()!='\n')
{
- std::cerr << "too much data in line" << std::endl;
+ std::wcerr << "too much data in line" << std::endl;
throw "data error";
}
is.ignore();
@@ -98,7 +99,7 @@
enBisentences.push_back( enSentenceListPretty[ bisentenceList[i].second ] );
}
-// std::cerr << huBisentences.size() << " bisentences collected." << std::endl;
+// std::wcerr << huBisentences.size() << " bisentences collected." << std::endl;
}
@@ -151,11 +152,11 @@
setSentenceValues( enSentenceList, enLength, alignParameters.utfCharCountingMode );
bool quasiglobal_stopwordRemoval = false;
-// std::cerr << "quasiglobal_stopwordRemoval is set to " << quasiglobal_stopwordRemoval << std::endl;
+// std::wcerr << "quasiglobal_stopwordRemoval is set to " << quasiglobal_stopwordRemoval << std::endl;
if (quasiglobal_stopwordRemoval)
{
removeStopwords( huSentenceListPretty, enSentenceList );
-// std::cerr << "Stopwords removed." << std::endl;
+// std::wcerr << "Stopwords removed." << std::endl;
}
SentenceList huSentenceListGarbled, enSentenceListGarbled;
@@ -185,9 +186,9 @@
if (thickness>maximalThickness)
{
-// std::cerr << "WARNING: Downgrading planned thickness " << thickness << " to " << maximalThickness ;
-// std::cerr << " to obey memory constraint of " << quasiglobal_maximalSizeInMegabytes << " megabytes " << std::endl;
-// std::cerr << "You should recompile if you have much more physical RAM than that. People of the near-future, forgive me for the inconvenience." << std::endl;
+// std::wcerr << "WARNING: Downgrading planned thickness " << thickness << " to " << maximalThickness ;
+// std::wcerr << " to obey memory constraint of " << quasiglobal_maximalSizeInMegabytes << " megabytes " << std::endl;
+// std::wcerr << "You should recompile if you have much more physical RAM than that. People of the near-future, forgive me for the inconvenience." << std::endl;
thickness = maximalThickness;
}
@@ -195,20 +196,20 @@
AlignMatrix similarityMatrix( huBookSize, enBookSize, thickness, outsideOfRadiusValue );
sentenceListsToAlignMatrixIdentity( huSentenceListGarbled, enSentenceListGarbled, similarityMatrix );
-// std::cerr << std::endl;
-// std::cerr << "Rough translation-based similarity matrix ready." << std::endl;
+// std::wcerr << std::endl;
+// std::wcerr << "Rough translation-based similarity matrix ready." << std::endl;
Trail bestTrail;
AlignMatrix dynMatrix( huBookSize+1, enBookSize+1, thickness, 1e30 );
align( similarityMatrix, huLength, enLength, bestTrail, dynMatrix );
-// std::cerr << "Align ready." << std::endl;
+// std::wcerr << "Align ready." << std::endl;
double globalQuality;
globalQuality = globalScoreOfTrail( bestTrail, dynMatrix,
huSentenceListGarbled, enSentenceListGarbled );
- // std::cerr << "Global quality of unfiltered align " << globalQuality << std::endl;
+ // std::wcerr << "Global quality of unfiltered align " << globalQuality << std::endl;
if (alignParameters.realignType==AlignParameters::NoRealign)
{
@@ -221,11 +222,11 @@
if (!success)
{
-// std::cerr << "Realign zone too close to quasidiagonal border. Abandoning realign. The align itself is suspicious." << std::endl;
+// std::wcerr << "Realign zone too close to quasidiagonal border. Abandoning realign. The align itself is suspicious." << std::endl;
}
else
{
-// std::cerr << "Border of realign zone determined." << std::endl;
+// std::wcerr << "Border of realign zone determined." << std::endl;
switch (alignParameters.realignType)
{
@@ -236,13 +237,13 @@
SentenceList huBisentences,enBisentences;
throw "unimplemented";
-// std::cerr << "Plausible bisentences filtered." << std::endl;
+// std::wcerr << "Plausible bisentences filtered." << std::endl;
modelOne.build(huBisentences,enBisentences);
-// std::cerr << "IBM Model I ready." << std::endl;
+// std::wcerr << "IBM Model I ready." << std::endl;
sentenceListsToAlignMatrixIBMModelOne( huSentenceListPretty, enSentenceList, modelOne, similarityMatrixDetailed );
-// std::cerr << "IBM Model I based similarity matrix ready." << std::endl;
+// std::wcerr << "IBM Model I based similarity matrix ready." << std::endl;
break;
}
case AlignParameters::FineTranslationRealign:
@@ -249,11 +250,11 @@
{
TransLex transLex;
transLex.build(dictionary);
-// std::cerr << "Hashtable for dictionary ready." << std::endl;
+// std::wcerr << "Hashtable for dictionary ready." << std::endl;
sentenceListsToAlignMatrixTranslation( huSentenceListPretty, enSentenceList, transLex, similarityMatrixDetailed );
-// std::cerr << "Fine translation-based similarity matrix ready." << std::endl;
+// std::wcerr << "Fine translation-based similarity matrix ready." << std::endl;
break;
}
@@ -267,7 +268,7 @@
Trail bestTrailDetailed;
AlignMatrix dynMatrixDetailed( huBookSize+1, enBookSize+1, thickness, 1e30 );
align( similarityMatrixDetailed, huLength, enLength, bestTrailDetailed, dynMatrixDetailed );
-// std::cerr << "Detail realign ready." << std::endl;
+// std::wcerr << "Detail realign ready." << std::endl;
bestTrail = bestTrailDetailed;
dynMatrix = dynMatrixDetailed;
@@ -275,7 +276,7 @@
globalQuality = globalScoreOfTrail( bestTrail, dynMatrix,
huSentenceListGarbled, enSentenceListGarbled );
- // std::cerr << "Global quality of unfiltered align after realign " << globalQuality << std::endl;
+ // std::wcerr << "Global quality of unfiltered align after realign " << globalQuality << std::endl;
}
}
@@ -284,27 +285,27 @@
if ( alignParameters.postprocessTrailQualityThreshold != -1 )
{
postprocessTrail( bestTrail, trailScoresInterval, alignParameters.postprocessTrailQualityThreshold );
-// std::cerr << "Trail start and end postprocessed by score." << std::endl;
+// std::wcerr << "Trail start and end postprocessed by score." << std::endl;
}
if ( alignParameters.postprocessTrailStartAndEndQualityThreshold != -1 )
{
postprocessTrailStartAndEnd( bestTrail, trailScoresInterval, alignParameters.postprocessTrailStartAndEndQualityThreshold );
-// std::cerr << "Trail start and end postprocessed by score." << std::endl;
+// std::wcerr << "Trail start and end postprocessed by score." << std::endl;
}
if ( alignParameters.postprocessTrailByTopologyQualityThreshold != -1 )
{
postprocessTrailByTopology( bestTrail, alignParameters.postprocessTrailByTopologyQualityThreshold );
-// std::cerr << "Trail postprocessed by topology." << std::endl;
+// std::wcerr << "Trail postprocessed by topology." << std::endl;
}
bool quasiglobal_spaceOutBySentenceLength = true;
-// std::cerr << "quasiglobal_spaceOutBySentenceLength is set to " << quasiglobal_spaceOutBySentenceLength << std::endl;
+// std::wcerr << "quasiglobal_spaceOutBySentenceLength is set to " << quasiglobal_spaceOutBySentenceLength << std::endl;
if (quasiglobal_spaceOutBySentenceLength)
{
spaceOutBySentenceLength( bestTrail, huSentenceListPretty, enSentenceList, alignParameters.utfCharCountingMode );
-// std::cerr << "Trail spaced out by sentence length." << std::endl;
+// std::wcerr << "Trail spaced out by sentence length." << std::endl;
}
// In cautious mode, auto-aligned rundles are thrown away if
@@ -312,13 +313,13 @@
if (alignParameters.cautiousMode)
{
cautiouslyFilterTrail( bestTrail );
-// std::cerr << "Trail filtered by topology." << std::endl;
+// std::wcerr << "Trail filtered by topology." << std::endl;
}
globalQuality = globalScoreOfTrail( bestTrail, dynMatrix,
huSentenceListGarbled, enSentenceListGarbled );
- // std::cerr << "Global quality of unfiltered align after realign " << globalQuality << std::endl;
+ // std::wcerr << "Global quality of unfiltered align after realign " << globalQuality << std::endl;
bool textual = ! alignParameters.justSentenceIds ;
@@ -428,17 +429,17 @@
std::ifstream hus(huFilename.c_str());
SentenceList huSentenceListPretty;
huSentenceListPretty.readNoIds( hus );
-// std::cerr << huSentenceListPretty.size() << " hungarian sentences read." << std::endl;
+// std::wcerr << huSentenceListPretty.size() << " hungarian sentences read." << std::endl;
std::ifstream ens(enFilename.c_str());
SentenceList enSentenceList;
enSentenceList.readNoIds( ens );
-// std::cerr << enSentenceList.size() << " english sentences read." << std::endl;
+// std::wcerr << enSentenceList.size() << " english sentences read." << std::endl;
if ( (enSentenceList. size() < huSentenceListPretty.size()/5) ||
(huSentenceListPretty.size() < enSentenceList. size()/5) )
{
-// std::cerr << "Sizes differing too much. Ignoring files to avoid a rare loop bug." << std::endl;
+// std::wcerr << "Sizes differing too much. Ignoring files to avoid a rare loop bug." << std::endl;
return;
}
@@ -447,7 +448,7 @@
/* double globalQuality = */alignerToolWithObjects
( dictionary, huSentenceListPretty, enSentenceList, alignParameters, std::cout );
-// std::cerr << "Quality " << globalQuality << std::endl ;
+// std::wcerr << "Quality " << globalQuality << std::endl ;
}
else
@@ -457,7 +458,7 @@
( dictionary, huSentenceListPretty, enSentenceList, alignParameters, os );
// If you want to collect global quality information in batch mode, grep "^Quality" of stderr must do.
-// std::cerr << "Quality\t" << outputFilename << "\t" << globalQuality << std::endl ;
+// std::wcerr << "Quality\t" << outputFilename << "\t" << globalQuality << std::endl ;
}
}
@@ -473,7 +474,7 @@
void main_alignerToolUsage()
{
- std::cerr << "Usage (either):\n\
+ std::wcerr << "Usage (either):\n\
alignerTool [ common_arguments ] [ -hand=hand_align_file ] dictionary_file source_text target_text\n\
\n\
or:\n\
@@ -585,8 +586,8 @@
if (batchMode && (remains.size()!=2) )
{
- std::cerr << "Batch mode requires exactly two file arguments." << std::endl;
- std::cerr << std::endl;
+ std::wcerr << "Batch mode requires exactly two file arguments." << std::endl;
+ std::wcerr << std::endl;
main_alignerToolUsage();
throw "argument error";
@@ -597,7 +598,7 @@
{
if (batchMode)
{
- std::cerr << "-batch and -" << handArgumentname << " are incompatible switches." << std::endl;
+ std::wcerr << "-batch and -" << handArgumentname << " are incompatible switches." << std::endl;
throw "argument error";
}
else
@@ -607,7 +608,7 @@
if (alignParameters.handAlignFilename.empty())
{
- std::cerr << "-" << handArgumentname << " switch requires a filename value." << std::endl;
+ std::wcerr << "-" << handArgumentname << " switch requires a filename value." << std::endl;
throw "argument error";
}
}
@@ -618,7 +619,7 @@
{
if (batchMode)
{
- std::cerr << "-batch and -" << autoDictDumpArgumentname << " are incompatible switches." << std::endl;
+ std::wcerr << "-batch and -" << autoDictDumpArgumentname << " are incompatible switches." << std::endl;
throw "argument error";
}
else
@@ -628,7 +629,7 @@
if (alignParameters.autoDictionaryDumpFilename.empty())
{
- std::cerr << "-" << autoDictDumpArgumentname << " switch requires a filename value." << std::endl;
+ std::wcerr << "-" << autoDictDumpArgumentname << " switch requires a filename value." << std::endl;
throw "argument error";
}
}
@@ -636,8 +637,8 @@
if (!batchMode && (remains.size()!=3) )
{
- std::cerr << "Nonbatch mode requires exactly three file arguments." << std::endl;
- std::cerr << std::endl;
+ std::wcerr << "Nonbatch mode requires exactly three file arguments." << std::endl;
+ std::wcerr << std::endl;
main_alignerToolUsage();
throw "argument error";
@@ -649,13 +650,13 @@
}
catch (...)
{
- std::cerr << std::endl;
+ std::wcerr << std::endl;
main_alignerToolUsage();
throw "argument error";
}
-// std::cerr << "Reading dictionary..." << std::endl;
+// std::wcerr << "Reading dictionary..." << std::endl;
const char* dicFilename = remains[0] ;
DictionaryItems dictionary;
std::ifstream dis(dicFilename);
@@ -676,7 +677,7 @@
if (words.size()!=3)
{
- std::cerr << "Batch file has incorrect format." << std::endl;
+ std::wcerr << "Batch file has incorrect format." << std::endl;
throw "data error";
}
@@ -685,7 +686,7 @@
enFilename = words[1];
outFilename = words[2];
-// std::cerr << "Processing " << outFilename << std::endl;
+// std::wcerr << "Processing " << outFilename << std::endl;
bool failed = false;
try
{
@@ -693,23 +694,23 @@
}
catch ( const char* errorType )
{
- std::cerr << errorType << std::endl;
+ std::wcerr << errorType << std::endl;
failed = true;
}
catch ( std::exception& e )
{
- std::cerr << "some failed assertion:" << e.what() << std::endl;
+ std::wcerr << "some failed assertion:" << e.what() << std::endl;
failed = true;
}
catch ( ... )
{
- std::cerr << "some unknown failed assertion..." << std::endl;
+ std::wcerr << "some unknown failed assertion..." << std::endl;
failed = true;
}
if (failed)
{
- std::cerr << "Align failed for " << outFilename << std::endl;
+ std::wcerr << "Align failed for " << outFilename << std::endl;
}
}
}
@@ -724,17 +725,17 @@
#ifndef _DEBUG
catch ( const char* errorType )
{
- std::cerr << errorType << std::endl;
+ std::wcerr << errorType << std::endl;
return -1;
}
catch ( std::exception& e )
{
- std::cerr << "some failed assertion:" << e.what() << std::endl;
+ std::wcerr << "some failed assertion:" << e.what() << std::endl;
return -1;
}
catch ( ... )
{
- std::cerr << "some unknown failed assertion..." << std::endl;
+ std::wcerr << "some unknown failed assertion..." << std::endl;
return -1;
}
#endif
Index: trunk/apertium/apertium/tmx_alignment.cc
===================================================================
--- trunk/apertium/apertium/tmx_alignment.cc (revision 69687)
+++ trunk/apertium/apertium/tmx_alignment.cc (revision 69688)
@@ -13,6 +13,7 @@
#include // For SentenceList
#include // For FrequencyMap
+#include
#include
#include