Merge branch 'trunk' into miramerge
Compiles, not tested. Conflicts: Jamroot OnDiskPt/PhraseNode.h OnDiskPt/TargetPhrase.cpp OnDiskPt/TargetPhrase.h OnDiskPt/TargetPhraseCollection.cpp mert/BleuScorer.cpp mert/Data.cpp mert/FeatureData.cpp moses-chart-cmd/src/Main.cpp moses/src/AlignmentInfo.h moses/src/ChartManager.cpp moses/src/LM/Ken.cpp moses/src/LM/Ken.h moses/src/LMList.h moses/src/LexicalReordering.h moses/src/PhraseDictionaryTree.h moses/src/ScoreIndexManager.h moses/src/StaticData.h moses/src/TargetPhrase.h moses/src/Word.cpp scripts/ems/experiment.meta scripts/ems/experiment.perl scripts/training/train-model.perl
14
Jamroot
@ -99,19 +99,7 @@ project : requirements
|
||||
$(requirements)
|
||||
;
|
||||
|
||||
#Add directories here if you want their incidental targets too (i.e. tests).
|
||||
build-project lm ;
|
||||
build-project util ;
|
||||
#Trigger instllation into legacy paths.
|
||||
build-project mert ;
|
||||
build-project moses-cmd/src ;
|
||||
build-project moses-chart-cmd/src ;
|
||||
build-project mira ;
|
||||
build-project moses/src ;
|
||||
#Scripts have their own binaries.
|
||||
build-project scripts ;
|
||||
#Regression tests (only does anything if --with-regtest is passed)
|
||||
build-project regression-testing ;
|
||||
build-projects util lm mert moses-cmd/src moses-chart-cmd/src mira scripts regression-testing ;
|
||||
|
||||
alias programs : lm//query lm//build_binary moses-chart-cmd/src//moses_chart moses-cmd/src//programs OnDiskPt//CreateOnDiskPt OnDiskPt//queryOnDiskPt mert//programs contrib/server//mosesserver misc//programs mira//programs symal phrase-extract phrase-extract//lexical-reordering phrase-extract//extract-ghkm phrase-extract//pcfg-extract phrase-extract//pcfg-score biconcor ;
|
||||
|
||||
|
3
NOTICE
Normal file
@ -0,0 +1,3 @@
|
||||
This code includes data from Daniel Naber's Language Tools (czech abbreviations).
|
||||
|
||||
This code includes data from czech wiktionary (also czech abbreviations).
|
@ -163,7 +163,7 @@ void OnDiskWrapper::EndSave()
|
||||
|
||||
void OnDiskWrapper::SaveMisc()
|
||||
{
|
||||
m_fileMisc << "Version 3" << endl;
|
||||
m_fileMisc << "Version 4" << endl;
|
||||
m_fileMisc << "NumSourceFactors " << m_numSourceFactors << endl;
|
||||
m_fileMisc << "NumTargetFactors " << m_numTargetFactors << endl;
|
||||
m_fileMisc << "NumScores " << m_numScores << endl;
|
||||
@ -172,12 +172,12 @@ void OnDiskWrapper::SaveMisc()
|
||||
|
||||
size_t OnDiskWrapper::GetSourceWordSize() const
|
||||
{
|
||||
return m_numSourceFactors * sizeof(UINT64) + sizeof(char);
|
||||
return sizeof(UINT64) + sizeof(char);
|
||||
}
|
||||
|
||||
size_t OnDiskWrapper::GetTargetWordSize() const
|
||||
{
|
||||
return m_numTargetFactors * sizeof(UINT64) + sizeof(char);
|
||||
return sizeof(UINT64) + sizeof(char);
|
||||
}
|
||||
|
||||
UINT64 OnDiskWrapper::GetMisc(const std::string &key) const
|
||||
@ -199,32 +199,37 @@ Word *OnDiskWrapper::ConvertFromMoses(Moses::FactorDirection /* direction */
|
||||
, const Moses::Word &origWord) const
|
||||
{
|
||||
bool isNonTerminal = origWord.IsNonTerminal();
|
||||
Word *newWord = new Word(1, isNonTerminal); // TODO - num of factors
|
||||
Word *newWord = new Word(isNonTerminal);
|
||||
stringstream strme;
|
||||
|
||||
for (size_t ind = 0 ; ind < factorsVec.size() ; ++ind) {
|
||||
size_t factorType = factorsVec[0];
|
||||
const Moses::Factor *factor = origWord.GetFactor(factorType);
|
||||
CHECK(factor);
|
||||
string str = factor->GetString();
|
||||
strme << str;
|
||||
|
||||
for (size_t ind = 1 ; ind < factorsVec.size() ; ++ind) {
|
||||
size_t factorType = factorsVec[ind];
|
||||
|
||||
const Moses::Factor *factor = origWord.GetFactor(factorType);
|
||||
if (factor == NULL)
|
||||
{ // can have less factors than factorType.size()
|
||||
break;
|
||||
}
|
||||
CHECK(factor);
|
||||
|
||||
string str = factor->GetString();
|
||||
if (isNonTerminal) {
|
||||
str = "[" + str + "]";
|
||||
}
|
||||
|
||||
bool found;
|
||||
UINT64 vocabId = m_vocab.GetVocabId(str, found);
|
||||
if (!found) {
|
||||
// factor not in phrase table -> phrse definately not in. exit
|
||||
delete newWord;
|
||||
return NULL;
|
||||
} else {
|
||||
newWord->SetVocabId(ind, vocabId);
|
||||
}
|
||||
strme << "|" << str;
|
||||
} // for (size_t factorType
|
||||
|
||||
return newWord;
|
||||
|
||||
bool found;
|
||||
UINT64 vocabId = m_vocab.GetVocabId(strme.str(), found);
|
||||
if (!found) {
|
||||
// factor not in phrase table -> phrse definately not in. exit
|
||||
delete newWord;
|
||||
return NULL;
|
||||
} else {
|
||||
newWord->SetVocabId(vocabId);
|
||||
return newWord;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -28,6 +28,10 @@ namespace OnDiskPt
|
||||
{
|
||||
const float DEFAULT_COUNT = 66666;
|
||||
|
||||
/** Global class with misc information need to create and use the on-disk rule table.
|
||||
* 1 object of this class should be instantiated per rule table.
|
||||
* Currently only hierarchical/syntax models use this, but can & should be used with pb models too
|
||||
*/
|
||||
class OnDiskWrapper
|
||||
{
|
||||
protected:
|
||||
|
@ -26,6 +26,8 @@ namespace OnDiskPt
|
||||
{
|
||||
class Vocab;
|
||||
|
||||
/** A contiguous phrase. SourcePhrase & TargetPhrase inherit from this and add the on-disk functionality
|
||||
*/
|
||||
class Phrase
|
||||
{
|
||||
friend std::ostream& operator<<(std::ostream&, const Phrase&);
|
||||
|
@ -228,20 +228,19 @@ void PhraseNode::GetChild(Word &wordFound, UINT64 &childFilePos, size_t ind, OnD
|
||||
|
||||
size_t wordSize = onDiskWrapper.GetSourceWordSize();
|
||||
size_t childSize = wordSize + sizeof(UINT64);
|
||||
size_t numFactors = onDiskWrapper.GetNumSourceFactors();
|
||||
|
||||
char *currMem = m_memLoad
|
||||
+ sizeof(UINT64) * 2 // size & file pos of target phrase coll
|
||||
+ sizeof(float) * onDiskWrapper.GetNumCounts() // count info
|
||||
+ childSize * ind;
|
||||
|
||||
size_t memRead = ReadChild(wordFound, childFilePos, currMem, numFactors);
|
||||
size_t memRead = ReadChild(wordFound, childFilePos, currMem);
|
||||
CHECK(memRead == childSize);
|
||||
}
|
||||
|
||||
size_t PhraseNode::ReadChild(Word &wordFound, UINT64 &childFilePos, const char *mem, size_t numFactors) const
|
||||
size_t PhraseNode::ReadChild(Word &wordFound, UINT64 &childFilePos, const char *mem) const
|
||||
{
|
||||
size_t memRead = wordFound.ReadFromMemory(mem, numFactors);
|
||||
size_t memRead = wordFound.ReadFromMemory(mem);
|
||||
|
||||
const char *currMem = mem + memRead;
|
||||
UINT64 *memArray = (UINT64*) (currMem);
|
||||
|
@ -31,6 +31,7 @@ namespace OnDiskPt
|
||||
class OnDiskWrapper;
|
||||
class SourcePhrase;
|
||||
|
||||
/** A node in the source tree trie */
|
||||
class PhraseNode
|
||||
{
|
||||
friend std::ostream& operator<<(std::ostream&, const PhraseNode&);
|
||||
@ -52,7 +53,7 @@ protected:
|
||||
void AddTargetPhrase(size_t pos, const SourcePhrase &sourcePhrase
|
||||
, TargetPhrase *targetPhrase, OnDiskWrapper &onDiskWrapper
|
||||
, size_t tableLimit, const std::vector<float> &counts, OnDiskPt::Phrase *spShort);
|
||||
size_t ReadChild(Word &wordFound, UINT64 &childFilePos, const char *mem, size_t numFactors) const;
|
||||
size_t ReadChild(Word &wordFound, UINT64 &childFilePos, const char *mem) const;
|
||||
void GetChild(Word &wordFound, UINT64 &childFilePos, size_t ind, OnDiskWrapper &onDiskWrapper) const;
|
||||
|
||||
public:
|
||||
|
@ -25,6 +25,8 @@
|
||||
namespace OnDiskPt
|
||||
{
|
||||
|
||||
/** A source phrase. No extension of a norm Phrase class because source phrases are saved as tries.
|
||||
*/
|
||||
class SourcePhrase: public Phrase
|
||||
{
|
||||
protected:
|
||||
|
@ -295,7 +295,7 @@ UINT64 TargetPhrase::ReadOtherInfoFromFile(UINT64 filePos, std::fstream &fileTPC
|
||||
return memUsed;
|
||||
}
|
||||
|
||||
UINT64 TargetPhrase::ReadFromFile(std::fstream &fileTP, size_t numFactors, size_t numSourceFactors)
|
||||
UINT64 TargetPhrase::ReadFromFile(std::fstream &fileTP)
|
||||
{
|
||||
UINT64 bytesRead = 0;
|
||||
|
||||
@ -307,7 +307,7 @@ UINT64 TargetPhrase::ReadFromFile(std::fstream &fileTP, size_t numFactors, size_
|
||||
|
||||
for (size_t ind = 0; ind < numWords; ++ind) {
|
||||
Word *word = new Word();
|
||||
bytesRead += word->ReadFromFile(fileTP, numFactors);
|
||||
bytesRead += word->ReadFromFile(fileTP);
|
||||
AddWord(word);
|
||||
}
|
||||
|
||||
@ -319,7 +319,7 @@ UINT64 TargetPhrase::ReadFromFile(std::fstream &fileTP, size_t numFactors, size_
|
||||
SourcePhrase *sp = new SourcePhrase();
|
||||
for (size_t ind = 0; ind < numSourceWords; ++ind) {
|
||||
Word *word = new Word();
|
||||
bytesRead += word->ReadFromFile(fileTP, numSourceFactors);
|
||||
bytesRead += word->ReadFromFile(fileTP);
|
||||
sp->AddWord(word);
|
||||
}
|
||||
SetSourcePhrase(sp);
|
||||
|
@ -43,6 +43,9 @@ typedef std::vector<AlignPair> AlignType;
|
||||
|
||||
class Vocab;
|
||||
|
||||
/** A target phrase, with the score breakdowns, alignment info and assorted other information it need.
|
||||
* Readable and writeable to disk
|
||||
*/
|
||||
class TargetPhrase: public Phrase
|
||||
{
|
||||
friend std::ostream& operator<<(std::ostream&, const TargetPhrase&);
|
||||
@ -102,7 +105,7 @@ public:
|
||||
, const Moses::WordPenaltyProducer* wpProducer
|
||||
, const Moses::LMList &lmList) const;
|
||||
UINT64 ReadOtherInfoFromFile(UINT64 filePos, std::fstream &fileTPColl);
|
||||
UINT64 ReadFromFile(std::fstream &fileTP, size_t numFactors, size_t numSourceFactors);
|
||||
UINT64 ReadFromFile(std::fstream &fileTP);
|
||||
|
||||
virtual void DebugPrint(std::ostream &out, const Vocab &vocab) const;
|
||||
|
||||
|
@ -156,9 +156,8 @@ void TargetPhraseCollection::ReadFromFile(size_t tableLimit, UINT64 filePos, OnD
|
||||
fstream &fileTP = onDiskWrapper.GetFileTargetInd();
|
||||
|
||||
size_t numScores = onDiskWrapper.GetNumScores();
|
||||
size_t numTargetFactors = onDiskWrapper.GetNumTargetFactors();
|
||||
size_t numSourceFactors = onDiskWrapper.GetNumSourceFactors();
|
||||
|
||||
|
||||
UINT64 numPhrases;
|
||||
|
||||
UINT64 currFilePos = filePos;
|
||||
@ -172,8 +171,9 @@ void TargetPhraseCollection::ReadFromFile(size_t tableLimit, UINT64 filePos, OnD
|
||||
|
||||
for (size_t ind = 0; ind < numPhrases; ++ind) {
|
||||
TargetPhrase *tp = new TargetPhrase(numScores);
|
||||
|
||||
UINT64 sizeOtherInfo = tp->ReadOtherInfoFromFile(currFilePos, fileTPColl);
|
||||
tp->ReadFromFile(fileTP, numTargetFactors, numSourceFactors);
|
||||
tp->ReadFromFile(fileTP);
|
||||
|
||||
currFilePos += sizeOtherInfo;
|
||||
|
||||
|
@ -33,6 +33,8 @@ class WordPenaltyProducer;
|
||||
namespace OnDiskPt
|
||||
{
|
||||
|
||||
/** A vector of target phrases
|
||||
*/
|
||||
class TargetPhraseCollection
|
||||
{
|
||||
class TargetPhraseOrderByScore
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <fstream>
|
||||
#include "OnDiskWrapper.h"
|
||||
#include "Vocab.h"
|
||||
#include "../moses/src/FactorCollection.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -69,13 +68,13 @@ void Vocab::Save(OnDiskWrapper &onDiskWrapper)
|
||||
}
|
||||
}
|
||||
|
||||
UINT64 Vocab::AddVocabId(const std::string &factorString)
|
||||
UINT64 Vocab::AddVocabId(const std::string &str)
|
||||
{
|
||||
// find string id
|
||||
CollType::const_iterator iter = m_vocabColl.find(factorString);
|
||||
CollType::const_iterator iter = m_vocabColl.find(str);
|
||||
if (iter == m_vocabColl.end()) {
|
||||
// add new vocab entry
|
||||
m_vocabColl[factorString] = m_nextId;
|
||||
m_vocabColl[str] = m_nextId;
|
||||
return m_nextId++;
|
||||
} else {
|
||||
// return existing entry
|
||||
@ -83,10 +82,10 @@ UINT64 Vocab::AddVocabId(const std::string &factorString)
|
||||
}
|
||||
}
|
||||
|
||||
UINT64 Vocab::GetVocabId(const std::string &factorString, bool &found) const
|
||||
UINT64 Vocab::GetVocabId(const std::string &str, bool &found) const
|
||||
{
|
||||
// find string id
|
||||
CollType::const_iterator iter = m_vocabColl.find(factorString);
|
||||
CollType::const_iterator iter = m_vocabColl.find(str);
|
||||
if (iter == m_vocabColl.end()) {
|
||||
found = false;
|
||||
return 0; //return whatever
|
||||
@ -97,14 +96,4 @@ UINT64 Vocab::GetVocabId(const std::string &factorString, bool &found) const
|
||||
}
|
||||
}
|
||||
|
||||
const Moses::Factor *Vocab::GetFactor(UINT32 vocabId, Moses::FactorType factorType, Moses::FactorDirection direction, bool isNonTerminal) const
|
||||
{
|
||||
string str = GetString(vocabId);
|
||||
if (isNonTerminal) {
|
||||
str = str.substr(1, str.size() - 2);
|
||||
}
|
||||
const Moses::Factor *factor = Moses::FactorCollection::Instance().AddFactor(direction, factorType, str);
|
||||
return factor;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,16 +22,15 @@
|
||||
#include <map>
|
||||
#include "../moses/src/TypeDef.h"
|
||||
|
||||
namespace Moses
|
||||
{
|
||||
class Factor;
|
||||
}
|
||||
|
||||
namespace OnDiskPt
|
||||
{
|
||||
|
||||
class OnDiskWrapper;
|
||||
|
||||
/* A bidirectional map of string<->contiguous id
|
||||
* No distinction between source and target language
|
||||
*/
|
||||
class Vocab
|
||||
{
|
||||
protected:
|
||||
@ -45,9 +44,8 @@ public:
|
||||
Vocab()
|
||||
:m_nextId(1)
|
||||
{}
|
||||
UINT64 AddVocabId(const std::string &factorString);
|
||||
UINT64 GetVocabId(const std::string &factorString, bool &found) const;
|
||||
const Moses::Factor *GetFactor(UINT32 vocabId, Moses::FactorType factorType, Moses::FactorDirection direction, bool isNonTerminal) const;
|
||||
UINT64 AddVocabId(const std::string &str);
|
||||
UINT64 GetVocabId(const std::string &str, bool &found) const;
|
||||
const std::string &GetString(UINT32 vocabId) const {
|
||||
return m_lookup[vocabId];
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
***********************************************************************/
|
||||
|
||||
#include "../moses/src/FactorCollection.h"
|
||||
#include "../moses/src/Util.h"
|
||||
#include "../moses/src/Word.h"
|
||||
#include "Word.h"
|
||||
@ -29,7 +30,7 @@ namespace OnDiskPt
|
||||
|
||||
Word::Word(const Word ©)
|
||||
:m_isNonTerminal(copy.m_isNonTerminal)
|
||||
,m_factors(copy.m_factors)
|
||||
,m_vocabId(copy.m_vocabId)
|
||||
{}
|
||||
|
||||
Word::~Word()
|
||||
@ -40,23 +41,21 @@ void Word::CreateFromString(const std::string &inString, Vocab &vocab)
|
||||
if (inString.substr(0, 1) == "[" && inString.substr(inString.size() - 1, 1) == "]") {
|
||||
// non-term
|
||||
m_isNonTerminal = true;
|
||||
string str = inString.substr(1, inString.size() - 2);
|
||||
m_vocabId = vocab.AddVocabId(str);
|
||||
} else {
|
||||
m_isNonTerminal = false;
|
||||
m_vocabId = vocab.AddVocabId(inString);
|
||||
}
|
||||
|
||||
m_factors.resize(1);
|
||||
m_factors[0] = vocab.AddVocabId(inString);
|
||||
}
|
||||
|
||||
size_t Word::WriteToMemory(char *mem) const
|
||||
{
|
||||
UINT64 *vocabMem = (UINT64*) mem;
|
||||
vocabMem[0] = m_vocabId;
|
||||
|
||||
// factors
|
||||
for (size_t ind = 0; ind < m_factors.size(); ind++)
|
||||
vocabMem[ind] = m_factors[ind];
|
||||
|
||||
size_t size = sizeof(UINT64) * m_factors.size();
|
||||
size_t size = sizeof(UINT64);
|
||||
|
||||
// is non-term
|
||||
char bNonTerm = (char) m_isNonTerminal;
|
||||
@ -66,16 +65,12 @@ size_t Word::WriteToMemory(char *mem) const
|
||||
return size;
|
||||
}
|
||||
|
||||
size_t Word::ReadFromMemory(const char *mem, size_t numFactors)
|
||||
size_t Word::ReadFromMemory(const char *mem)
|
||||
{
|
||||
m_factors.resize(numFactors);
|
||||
UINT64 *vocabMem = (UINT64*) mem;
|
||||
m_vocabId = vocabMem[0];
|
||||
|
||||
// factors
|
||||
for (size_t ind = 0; ind < m_factors.size(); ind++)
|
||||
m_factors[ind] = vocabMem[ind];
|
||||
|
||||
size_t memUsed = sizeof(UINT64) * m_factors.size();
|
||||
size_t memUsed = sizeof(UINT64);
|
||||
|
||||
// is non-term
|
||||
char bNonTerm;
|
||||
@ -86,13 +81,13 @@ size_t Word::ReadFromMemory(const char *mem, size_t numFactors)
|
||||
return memUsed;
|
||||
}
|
||||
|
||||
size_t Word::ReadFromFile(std::fstream &file, size_t numFactors)
|
||||
size_t Word::ReadFromFile(std::fstream &file)
|
||||
{
|
||||
size_t memAlloc = numFactors * sizeof(UINT64) + sizeof(char);
|
||||
size_t memAlloc = sizeof(UINT64) + sizeof(char);
|
||||
char *mem = (char*) malloc(memAlloc);
|
||||
file.read(mem, memAlloc);
|
||||
|
||||
size_t memUsed = ReadFromMemory(mem, numFactors);
|
||||
size_t memUsed = ReadFromMemory(mem);
|
||||
CHECK(memAlloc == memUsed);
|
||||
free(mem);
|
||||
|
||||
@ -103,12 +98,14 @@ Moses::Word *Word::ConvertToMoses(Moses::FactorDirection direction
|
||||
, const std::vector<Moses::FactorType> &outputFactorsVec
|
||||
, const Vocab &vocab) const
|
||||
{
|
||||
Moses::FactorCollection &factorColl = Moses::FactorCollection::Instance();
|
||||
Moses::Word *ret = new Moses::Word(m_isNonTerminal);
|
||||
|
||||
for (size_t ind = 0; ind < m_factors.size(); ++ind) {
|
||||
const string &str = vocab.GetString(m_vocabId);
|
||||
vector<string> toks = Moses::Tokenize(str, "|");
|
||||
for (size_t ind = 0; ind < toks.size(); ++ind) {
|
||||
Moses::FactorType factorType = outputFactorsVec[ind];
|
||||
UINT32 vocabId = m_factors[ind];
|
||||
const Moses::Factor *factor = vocab.GetFactor(vocabId, factorType, direction, m_isNonTerminal);
|
||||
const Moses::Factor *factor = factorColl.AddFactor(direction, factorType, toks[ind]);
|
||||
ret->SetFactor(factorType, factor);
|
||||
}
|
||||
|
||||
@ -123,9 +120,9 @@ int Word::Compare(const Word &compare) const
|
||||
if (m_isNonTerminal != compare.m_isNonTerminal)
|
||||
return m_isNonTerminal ?-1 : 1;
|
||||
|
||||
if (m_factors < compare.m_factors)
|
||||
if (m_vocabId < compare.m_vocabId)
|
||||
ret = -1;
|
||||
else if (m_factors > compare.m_factors)
|
||||
else if (m_vocabId > compare.m_vocabId)
|
||||
ret = 1;
|
||||
else
|
||||
ret = 0;
|
||||
@ -147,27 +144,14 @@ bool Word::operator==(const Word &compare) const
|
||||
|
||||
void Word::DebugPrint(ostream &out, const Vocab &vocab) const
|
||||
{
|
||||
std::vector<UINT64>::const_iterator iter;
|
||||
for (size_t ind = 0; ind < m_factors.size() - 1; ++ind) {
|
||||
UINT64 vocabId = *iter;
|
||||
const string &str = vocab.GetString(vocabId);
|
||||
out << str << "|";
|
||||
}
|
||||
|
||||
// last
|
||||
UINT64 vocabId = m_factors.back();
|
||||
const string &str = vocab.GetString(vocabId);
|
||||
out << str;
|
||||
const string &str = vocab.GetString(m_vocabId);
|
||||
out << str;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream &out, const Word &word)
|
||||
{
|
||||
out << "(";
|
||||
|
||||
std::vector<UINT64>::const_iterator iter;
|
||||
for (iter = word.m_factors.begin(); iter != word.m_factors.end(); ++iter) {
|
||||
out << *iter << "|";
|
||||
}
|
||||
out << word.m_vocabId;
|
||||
|
||||
out << (word.m_isNonTerminal ? "n" : "t");
|
||||
out << ")";
|
||||
|
@ -33,21 +33,24 @@ namespace OnDiskPt
|
||||
{
|
||||
class Vocab;
|
||||
|
||||
/* A wrapper around a vocab id, and a boolean indicating whther it is a term or non-term.
|
||||
* Factors can be represented by using a vocab string with | character, eg go|VB
|
||||
*/
|
||||
class Word
|
||||
{
|
||||
friend std::ostream& operator<<(std::ostream&, const Word&);
|
||||
|
||||
protected:
|
||||
bool m_isNonTerminal;
|
||||
std::vector<UINT64> m_factors;
|
||||
UINT64 m_vocabId;
|
||||
|
||||
public:
|
||||
explicit Word()
|
||||
{}
|
||||
|
||||
explicit Word(size_t numFactors, bool isNonTerminal)
|
||||
explicit Word(bool isNonTerminal)
|
||||
:m_isNonTerminal(isNonTerminal)
|
||||
,m_factors(numFactors)
|
||||
,m_vocabId(0)
|
||||
{}
|
||||
|
||||
Word(const Word ©);
|
||||
@ -60,11 +63,11 @@ public:
|
||||
}
|
||||
|
||||
size_t WriteToMemory(char *mem) const;
|
||||
size_t ReadFromMemory(const char *mem, size_t numFactors);
|
||||
size_t ReadFromFile(std::fstream &file, size_t numFactors);
|
||||
size_t ReadFromMemory(const char *mem);
|
||||
size_t ReadFromFile(std::fstream &file);
|
||||
|
||||
void SetVocabId(size_t ind, UINT32 vocabId) {
|
||||
m_factors[ind] = vocabId;
|
||||
void SetVocabId(UINT32 vocabId) {
|
||||
m_vocabId = vocabId;
|
||||
}
|
||||
|
||||
Moses::Word *ConvertToMoses(Moses::FactorDirection direction
|
||||
|
@ -1,594 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
# -*- coding: utf_8 -*-
|
||||
"""This program is used to prepare corpora extracted from TMX files.
|
||||
It is particularly useful for translators not very familiar
|
||||
with machine translation systems that want to use Moses with a highly customised
|
||||
corpus.
|
||||
|
||||
It extracts from a directory containing TMX files (and from all of its subdirectories)
|
||||
all the segments of one or more language pairs (except empty segments and segments that are equal in both languages)
|
||||
and removes all other information. It then creates 2 separate monolingual files per language pair,
|
||||
both of which have strictly parallel (aligned) segments. This kind of corpus can easily be transformed
|
||||
in other formats, if need be.
|
||||
|
||||
The program requires that Pythoncard and wxPython (as well as Python) be previously installed.
|
||||
|
||||
Copyright 2009, João L. A. C. Rosas
|
||||
|
||||
Distributed under GNU GPL v3 licence (see http://www.gnu.org/licenses/)
|
||||
|
||||
E-mail: extracttmxcorpus@gmail.com """
|
||||
|
||||
__version__ = "$Revision: 1.043$"
|
||||
__date__ = "$Date: 2011/08/13$"
|
||||
__author__="$João L. A. C. Rosas$"
|
||||
#Special thanks to Gary Daine for a helpful suggestion about a regex expression
|
||||
#Updated to run on Linux by Tom Hoar
|
||||
|
||||
from PythonCard import clipboard, dialog, graphic, model
|
||||
from PythonCard.components import button, combobox,statictext,checkbox,staticbox
|
||||
import wx
|
||||
import os, re
|
||||
import string
|
||||
import sys
|
||||
from time import strftime
|
||||
import codecs
|
||||
|
||||
|
||||
class Extract_TMX_Corpus(model.Background):
|
||||
|
||||
def on_initialize(self, event):
|
||||
"""Initialize values
|
||||
|
||||
|
||||
@self.inputdir: directory whose files will be treated
|
||||
@self.outputfile: base name of the resulting corpora files
|
||||
@self.outputpath: root directory of the resulting corpora files
|
||||
@currdir: program's current working directory
|
||||
@self.languages: list of languages whose segments can be processed
|
||||
@self.startinglanguage: something like 'EN-GB'
|
||||
@self.destinationlanguage: something like 'FR-FR'
|
||||
@self.components.cbStartingLanguage.items: list of values of the Starting Language combobox of the program's window
|
||||
@self.components.cbDestinationLanguage.items: list of values of the Destination Language combobox of the program's window
|
||||
@self.numtus: number of translation units extracted so far
|
||||
@self.presentfile: TMX file being currently processed
|
||||
@self.errortypes: variable that stocks the types of errors detected in the TMX file that is being processed
|
||||
@self.wroteactions: variable that indicates whether the actions files has already been written to
|
||||
"""
|
||||
|
||||
self.inputdir=''
|
||||
self.outputfile=''
|
||||
self.outputpath=''
|
||||
#Get directory where program file is and ...
|
||||
currdir=os.path.abspath(os.path.dirname(os.path.realpath(sys.argv[0])))
|
||||
#... load the file ("LanguageCodes.txt") with the list of languages that the program can process
|
||||
try:
|
||||
self.languages=open(currdir+os.sep+r'LanguageCodes.txt','r+').readlines()
|
||||
except:
|
||||
# If the languages file doesn't exist in the program directory, alert user that it is essential for the good working of the program and exit
|
||||
result = dialog.alertDialog(self, 'The file "LanguageCodes.txt" is missing. The program will now close.', 'Essential file missing')
|
||||
sys.exit()
|
||||
#remove end of line marker from each line in "LanguageCodes.txt"
|
||||
for lang in range(len(self.languages)):
|
||||
self.languages[lang]=self.languages[lang].rstrip()
|
||||
self.startinglanguage=''
|
||||
self.destinationlanguage=''
|
||||
#Insert list of language names in appropriate program window's combo boxes
|
||||
self.components.cbStartingLanguage.items=self.languages
|
||||
self.components.cbDestinationLanguage.items=self.languages
|
||||
self.tottus=0
|
||||
self.numtus=0
|
||||
self.numequaltus=0
|
||||
self.presentfile=''
|
||||
self.errortypes=''
|
||||
self.wroteactions=False
|
||||
self.errors=''
|
||||
|
||||
def extract_language_segments_tmx(self,text):
|
||||
"""Extracts TMX language segments from TMX files
|
||||
|
||||
@text: the text of the TMX file
|
||||
@pattern: compiled regular expression object, which can be used for matching
|
||||
@tus: list that collects the translation units of the text
|
||||
@segs: list that collects the segment units of the relevant pair of languages
|
||||
@numtus: number of translation units extracted
|
||||
@present_tu: variable that stocks the translation unit relevant segments (of the chosen language pair) that are being processed
|
||||
@self.errortypes: variable that stocks the types of errors detected in the TMX file that is being processed
|
||||
"""
|
||||
#print 'extract_language_segments: start at '+strftime('%H-%M-%S')
|
||||
result=('','')
|
||||
try:
|
||||
if text:
|
||||
# Convert character entities to "normal" characters
|
||||
pattern=re.compile('>',re.U)
|
||||
text=re.sub(pattern,'>',text)
|
||||
pattern=re.compile('<',re.U)
|
||||
text=re.sub(pattern,'<',text)
|
||||
pattern=re.compile('&',re.U)
|
||||
text=re.sub(pattern,'&',text)
|
||||
pattern=re.compile('"',re.U)
|
||||
text=re.sub(pattern,'"',text)
|
||||
pattern=re.compile(''',re.U)
|
||||
text=re.sub(pattern,"'",text)
|
||||
# Extract translation units
|
||||
pattern=re.compile('(?s)<tu.*?>(.*?)</tu>')
|
||||
tus=re.findall(pattern,text)
|
||||
ling1=''
|
||||
ling2=''
|
||||
#Extract relevant segments and store them in the @text variable
|
||||
if tus:
|
||||
for tu in tus:
|
||||
pattern=re.compile('(?s)<tuv.*?lang="'+self.startinglanguage+'">.*?<seg>(.*?)</seg>.*?<tuv.*?lang="'+self.destinationlanguage+'">.*?<seg>(.*?)</seg>')
|
||||
present_tu=re.findall(pattern,tu)
|
||||
self.tottus+=1
|
||||
#reject empty segments
|
||||
if present_tu: # and not present_tu[0][0].startswith("<")
|
||||
present_tu1=present_tu[0][0].strip()
|
||||
present_tu2=present_tu[0][1].strip()
|
||||
present_tu1 = re.sub('<bpt.*</bpt>', '', present_tu1)
|
||||
present_tu2 = re.sub('<bpt.*</bpt>', '', present_tu2)
|
||||
present_tu1 = re.sub(r'<ept.*</ept>', '', present_tu1)
|
||||
present_tu2 = re.sub(r'<ept.*</ept>', '', present_tu2)
|
||||
present_tu1 = re.sub(r'<ut.*</ut>', '', present_tu1)
|
||||
present_tu2 = re.sub(r'<ut.*</ut>', '', present_tu2)
|
||||
present_tu1 = re.sub(r'<ph.*</ph>', '', present_tu1)
|
||||
present_tu2 = re.sub(r'<ph.*</ph>', '', present_tu2)
|
||||
#Thanks to Gary Daine
|
||||
present_tu1 = re.sub('^[0-9\.() \t\-_]*$', '', present_tu1)
|
||||
#Thanks to Gary Daine
|
||||
present_tu2 = re.sub('^[0-9\.() \t\-_]*$', '', present_tu2)
|
||||
if present_tu1 != present_tu2:
|
||||
x=len(present_tu1)
|
||||
y=len(present_tu2)
|
||||
if (x <= y*3) and (y <= x*3):
|
||||
ling1=ling1+present_tu1+'\n'
|
||||
ling2=ling2+present_tu2+'\n'
|
||||
self.numtus+=1
|
||||
else:
|
||||
self.numequaltus+=1
|
||||
pattern=re.compile('(?s)<tuv.*?lang="'+self.destinationlanguage+'">.*?<seg>(.*?)</seg>.*?<tuv.*?lang="'+self.startinglanguage+'">.*?<seg>(.*?)</seg>')
|
||||
present_tu=re.findall(pattern,tu)
|
||||
#print present_tu
|
||||
if present_tu:
|
||||
present_tu1=present_tu[0][1].strip()
|
||||
present_tu2=present_tu[0][0].strip()
|
||||
present_tu1 = re.sub('<bpt.*</bpt>', '', present_tu1)
|
||||
present_tu2 = re.sub('<bpt.*</bpt>', '', present_tu2)
|
||||
present_tu1 = re.sub(r'<ept.*</ept>', '', present_tu1)
|
||||
present_tu2 = re.sub(r'<ept.*</ept>', '', present_tu2)
|
||||
present_tu1 = re.sub(r'<ut.*</ut>', '', present_tu1)
|
||||
present_tu2 = re.sub(r'<ut.*</ut>', '', present_tu2)
|
||||
present_tu1 = re.sub(r'<ph.*</ph>', '', present_tu1)
|
||||
present_tu2 = re.sub(r'<ph.*</ph>', '', present_tu2)
|
||||
#Thanks to Gary Daine
|
||||
present_tu1 = re.sub('^[0-9\.() \t\-_]*$', '', present_tu1)
|
||||
#Thanks to Gary Daine
|
||||
present_tu2 = re.sub('^[0-9\.() \t\-_]*$', '', present_tu2)
|
||||
if present_tu1 != present_tu2:
|
||||
x=len(present_tu1)
|
||||
y=len(present_tu2)
|
||||
if (x <= y*3) and (y <= x*3):
|
||||
ling1=ling1+present_tu1+'\n'
|
||||
ling2=ling2+present_tu2+'\n'
|
||||
self.numtus+=1
|
||||
else:
|
||||
self.numequaltus+=1
|
||||
result=(ling1,ling2)
|
||||
except:
|
||||
self.errortypes=self.errortypes+' - Extract Language Segments error\n'
|
||||
return result
|
||||
|
||||
def locate(self,pattern, basedir):
|
||||
"""Locate all files matching supplied filename pattern in and below
|
||||
supplied root directory.
|
||||
|
||||
@pattern: something like '*.tmx'
|
||||
@basedir:whole directory to be treated
|
||||
"""
|
||||
import fnmatch
|
||||
for path, dirs, files in os.walk(os.path.abspath(basedir)):
|
||||
for filename in fnmatch.filter(files, pattern):
|
||||
yield os.path.join(path, filename)
|
||||
|
||||
def getallsegments(self):
|
||||
"""Get all language segments from the TMX files in the specified
|
||||
directory
|
||||
|
||||
@self.startinglanguage: something like 'EN-GB'
|
||||
@self.destinationlanguage: something like 'FR-FR'
|
||||
@fileslist: list of files that should be processed
|
||||
@self.inputdir: directory whose files will be treated
|
||||
@startfile:output file containing all segments in the @startinglanguage; file
|
||||
will be created in @self.inputdir
|
||||
@destfile:output file containing all segments in the @destinationlanguage; file
|
||||
will be created in @self.inputdir
|
||||
@actions:output file indicating the names of all files that were processed without errors; file
|
||||
will be created in @self.inputdir
|
||||
@self.errortypes: variable that stocks the types of errors detected in the TMX file that is being processed
|
||||
@self.presentfile: TMX file being currently processed
|
||||
@preptext: parsed XML text with all tags extracted and in string format
|
||||
@tus: list that receives the extracted TMX language translation units just with segments of the relevant language pair
|
||||
@num: loop control variable between 0 and length of @tus - 1
|
||||
@self.numtus: number of translation units extracted so far
|
||||
"""
|
||||
self.statusBar.text='Processing '+ self.inputdir
|
||||
try:
|
||||
# Get a list of all TMX files that need to be processed
|
||||
fileslist=self.locate('*.tmx',self.inputdir)
|
||||
# Open output files for writing
|
||||
startfile=open(self.outputpath+os.sep+self.startinglanguage+ ' ('+self.destinationlanguage+')_' +self.outputfile,'w+b')
|
||||
destfile=open(self.outputpath+os.sep+self.destinationlanguage+' ('+self.startinglanguage+')_'+self.outputfile,'w+b')
|
||||
actions=open(self.outputpath+os.sep+'_processing_info'+os.sep+self.startinglanguage+ '-'+self.destinationlanguage+'_'+'actions_'+self.outputfile+'.txt','w+')
|
||||
except:
|
||||
# if any error up to now, add the name of the TMX file to the output file @errors
|
||||
self.errortypes=self.errortypes+' - Get All Segments: creation of output files error\n'
|
||||
if fileslist:
|
||||
# For each relevant TMX file ...
|
||||
for self.presentfile in fileslist:
|
||||
self.errortypes=''
|
||||
try:
|
||||
print self.presentfile
|
||||
fileObj = codecs.open(self.presentfile, "rb", "utf-16","replace",0 )
|
||||
pos=0
|
||||
while True:
|
||||
# read a new chunk of text...
|
||||
preptext = fileObj.read(692141)
|
||||
if not preptext:
|
||||
break
|
||||
last5=''
|
||||
y=''
|
||||
#... and make it end at the end of a translation unit
|
||||
while True:
|
||||
y=fileObj.read(1)
|
||||
if not y:
|
||||
break
|
||||
last5=last5+y
|
||||
if '</tu>' in last5:
|
||||
break
|
||||
preptext=preptext+last5
|
||||
# ... and extract its relevant segments ...
|
||||
if not self.errortypes:
|
||||
segs1,segs2=self.extract_language_segments_tmx(preptext)
|
||||
preptext=''
|
||||
#... and write those segments to the output files
|
||||
if segs1 and segs2:
|
||||
try:
|
||||
startfile.write('%s' % (segs1.encode('utf-8','strict')))
|
||||
destfile.write('%s' % (segs2.encode('utf-8','strict')))
|
||||
except:
|
||||
self.errortypes=self.errortypes+' - Get All Segments: writing of output files error\n'
|
||||
print 'erro'
|
||||
#if no errors up to now, insert the name of the TMX file in the @actions output file
|
||||
#encoding is necessary because @actions may be in a directory whose name has special diacritic characters
|
||||
if self.errortypes=='':
|
||||
try:
|
||||
actions.write(self.presentfile.encode('utf_8','replace')+'\n')
|
||||
self.wroteactions=True
|
||||
except:
|
||||
self.errortypes=self.errortypes+' - Get All Segments: writing of actions file error\n'
|
||||
fileObj.close()
|
||||
except:
|
||||
self.errortypes=self.errortypes+' - Error reading input file\n'
|
||||
try:
|
||||
if self.wroteactions:
|
||||
actions.write('\n*************************************************\n\n')
|
||||
actions.write('Total number of translation units: '+str(self.tottus)+'\n')
|
||||
actions.write('Number of extracted translation units (source segment not equal to destination segment): '+str(self.numtus)+'\n')
|
||||
actions.write('Number of removed translation units (source segment equal to destination segment): '+str(self.numequaltus)+'\n')
|
||||
actions.write('Number of empty translation units (source segment and/or destination segment not present): '+str(self.tottus-self.numequaltus-self.numtus))
|
||||
|
||||
except:
|
||||
self.errortypes=self.errortypes+' - Get All Segments: writing of actions file error\n'
|
||||
# Close output files
|
||||
actions.close()
|
||||
destfile.close()
|
||||
startfile.close()
|
||||
|
||||
def SelectDirectory(self):
|
||||
"""Select the directory where the TMX files to be processed are
|
||||
|
||||
@result: object returned by the dialog window with attributes accepted (true if user clicked OK button, false otherwise) and
|
||||
path (list of strings containing the full pathnames to all files selected by the user)
|
||||
@self.inputdir: directory where TMX files to be processed are (and where output files will be written)
|
||||
@self.statusBar.text: text displayed in the program window status bar"""
|
||||
|
||||
result= dialog.directoryDialog(self, 'Choose a directory', 'a')
|
||||
if result.accepted:
|
||||
self.inputdir=result.path
|
||||
self.statusBar.text=self.inputdir+' selected.'
|
||||
|
||||
def on_menuFileSelectDirectory_select(self, event):
|
||||
self.SelectDirectory()
|
||||
|
||||
def on_btnSelectDirectory_mouseClick(self, event):
|
||||
self.SelectDirectory()
|
||||
|
||||
def GetOutputFileBaseName(self):
|
||||
"""Get base name of the corpus files
|
||||
|
||||
@expr: variable containing the base name of the output files
|
||||
@wildcard: list of wildcards used in the dialog window to filter types of files
|
||||
@result: object returned by the Open File dialog window with attributes accepted (true if user clicked OK button, false otherwise) and
|
||||
path (list of strings containing the full pathnames to all files selected by the user)
|
||||
@self.inputdir: directory where TMX files to be processed are (and where output files will be written)
|
||||
@location: variable containing the full path to the base name output file
|
||||
@self.outputpath: base directory of output files
|
||||
@self.outputfile: base name of the output files
|
||||
"""
|
||||
|
||||
# Default base name of the corpora files that will be produced. If you choose as base name "Corpus.txt", as starting language "EN-GB" and as destination
|
||||
# language "FR-FR" the corpora files will be named "Corpus_EN-GB.txt" and "Corpus_FR-FR.txt"
|
||||
expr='Corpus'
|
||||
#open a dialog that lets you choose the base name of the corpora files that will be produced.
|
||||
wildcard = "Text files (*.txt;*.TXT)|*.txt;*.TXT"
|
||||
result = dialog.openFileDialog(None, "Name of corpus file", self.inputdir,expr,wildcard=wildcard)
|
||||
if result.accepted:
|
||||
location=os.path.split(result.paths[0])
|
||||
self.outputpath=location[0]
|
||||
self.outputfile = location[1]
|
||||
if not os.path.exists(self.outputpath+os.sep+'_processing_info'):
|
||||
try:
|
||||
os.mkdir(self.outputpath+os.sep+'_processing_info')
|
||||
except:
|
||||
result1 = dialog.alertDialog(self, "The program can't create the directory " + self.outputpath+os.sep+r'_processing_info, which is necessary for ' + \
|
||||
'the creation of the output files. The program will now close.','Error')
|
||||
sys.exit()
|
||||
|
||||
def on_menuGetOutputFileBaseName_select(self, event):
|
||||
self.GetOutputFileBaseName()
|
||||
|
||||
def on_btnGetOutputFileBaseName_mouseClick(self, event):
|
||||
self.GetOutputFileBaseName()
|
||||
|
||||
def ExtractCorpus(self):
|
||||
"""Get the directory where TMX files to be processed are, get the choice of the pair of languages that will be treated and launch the extraction
|
||||
of the corpus
|
||||
|
||||
@self.errortypes: variable that stocks the types of errors detected in the TMX file that is being processed
|
||||
@self.presentfile: TMX file being currently processed
|
||||
@self.numtus: number of translation units extracted so far
|
||||
@self.startinglanguage: something like 'EN-GB'
|
||||
@self.destinationlanguage: something like 'FR-FR'
|
||||
@self.inputdir: directory whose files will be treated
|
||||
@self.components.cbStartingLanguage.items: list of values of the Starting Language combobox of the program's window
|
||||
@self.components.cbDestinationLanguage.items: list of values of the Destination Language combobox of the program's window
|
||||
@self.outputfile: base name of the resulting corpora files
|
||||
@self.errors:output file indicating the types of error that occurred in each processed TMX file
|
||||
@self.numtus: number of translation units extracted so far
|
||||
"""
|
||||
|
||||
print 'Extract corpus: started at '+strftime('%H-%M-%S')
|
||||
self.errortypes=''
|
||||
self.presentfile=''
|
||||
self.numtus=0
|
||||
#get the startinglanguage name (e.g.: "EN-GB") from the program window
|
||||
self.startinglanguage=self.components.cbStartingLanguage.text
|
||||
#get the destinationlanguage name from the program window
|
||||
self.destinationlanguage=self.components.cbDestinationLanguage.text
|
||||
#if the directory where TMX files (@inputdir) or the pair of languages were not previously chosen, open a dialog box explaining
|
||||
#the conditions that have to be met so that the extraction can be made and do nothing...
|
||||
if (self.inputdir=='') or (self.components.cbStartingLanguage.text=='') or (self.components.cbDestinationLanguage.text=='') or (self.outputfile=='') \
|
||||
or (self.components.cbStartingLanguage.text==self.components.cbDestinationLanguage.text):
|
||||
result = dialog.alertDialog(self, 'In order to extract a corpus, you need to:\n\n 1) indicate the directory where the TMX files are,\n 2)' \
|
||||
+' the starting language,\n 3) the destination language (the 2 languages must be different), and\n 4) the base name of the output files.', 'Error')
|
||||
|
||||
#...else, go ahead
|
||||
else:
|
||||
try:
|
||||
self.errors=open(self.outputpath+os.sep+'_processing_info'+os.sep+self.startinglanguage+ '-'+self.destinationlanguage+'_'+'errors_'+self.outputfile+'.txt','w+')
|
||||
except:
|
||||
pass
|
||||
self.statusBar.text='Please wait. This can be a long process ...'
|
||||
#Launch the segment extraction
|
||||
self.numtus=0
|
||||
self.getallsegments()
|
||||
# if any error up to now, add the name of the TMX file to the output file @errors
|
||||
if self.errortypes:
|
||||
try:
|
||||
self.errors.write(self.presentfile.encode('utf_8','replace')+':\n'+self.errortypes)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
self.errors.close()
|
||||
except:
|
||||
pass
|
||||
self.statusBar.text='Processing finished.'
|
||||
#Open dialog box telling that processing is finished and where can the resulting files be found
|
||||
self.inputdir=''
|
||||
self.outputfile=''
|
||||
self.outputpath=''
|
||||
print 'Extract corpus: finished at '+strftime('%H-%M-%S')
|
||||
result = dialog.alertDialog(self, 'Processing done. Results found in:\n\n1) '+ \
|
||||
self.outputpath+os.sep+self.startinglanguage+ ' ('+self.destinationlanguage+')_' +self.outputfile+ ' (starting language corpus)\n2) '+ \
|
||||
self.outputpath+os.sep+self.destinationlanguage+' ('+self.startinglanguage+')_'+self.outputfile+ \
|
||||
' (destination language corpus)\n3) '+self.outputpath+os.sep+'_processing_info'+os.sep+self.startinglanguage+ '-'+self.destinationlanguage+'_'+ \
|
||||
'errors_'+self.outputfile+'.txt'+ ' (list of files that caused errors)\n4) '+self.outputpath+os.sep+'_processing_info'+os.sep+self.startinglanguage+ \
|
||||
'-'+self.destinationlanguage+'_'+'actions_'+self.outputfile+'.txt'+ ' (list of files where processing was successful)', 'Processing Done')
|
||||
|
||||
def on_menuFileExtractCorpus_select(self, event):
|
||||
self.ExtractCorpus()
|
||||
def on_btnExtractCorpus_mouseClick(self, event):
|
||||
self.ExtractCorpus()
|
||||
|
||||
def ExtractAllCorpora(self):
|
||||
"""Extracts all the LanguagePairs that can be composed with the languages indicated in the file "LanguageCodes.txt"
|
||||
|
||||
@self.presentfile: TMX file being currently processed
|
||||
@self.numtus: number of translation units extracted so far
|
||||
@numcorpora: number of language pair being processed
|
||||
@self.inputdir: directory whose files will be treated
|
||||
@self.outputfile: base name of the resulting corpora files
|
||||
@self.errors:output file indicating the types of error that occurred in each processed TMX file
|
||||
@self.startinglanguage: something like 'EN-GB'
|
||||
@self.destinationlanguage: something like 'FR-FR'
|
||||
@lang1: code of the starting language
|
||||
@lang2: code of the destination language
|
||||
@self.errortypes: variable that stocks the types of errors detected in the TMX file that is being processed
|
||||
@self.wroteactions: variable that indicates whether the actions files has already been written to
|
||||
"""
|
||||
|
||||
print 'Extract All Corpora: started at '+strftime('%H-%M-%S')
|
||||
self.presentfile=''
|
||||
self.numtus=0
|
||||
numcorpora=0
|
||||
#if the directory where TMX files (@inputdir) or the base name of the output files were not previously chosen, open a dialog box explaining
|
||||
#the conditions that have to be met so that the extraction can be made and do nothing...
|
||||
if (self.inputdir=='') or (self.outputfile==''):
|
||||
result = dialog.alertDialog(self, 'In order to extract all corpora, you need to:\n\n 1) indicate the directory where the TMX files are, and\n ' \
|
||||
+ '2) the base name of the output files.', 'Error')
|
||||
#...else, go ahead
|
||||
else:
|
||||
try:
|
||||
for lang1 in self.languages:
|
||||
for lang2 in self.languages:
|
||||
if lang2 > lang1:
|
||||
print lang1+'/'+lang2+' corpus being created...'
|
||||
numcorpora=numcorpora+1
|
||||
self.errortypes=''
|
||||
self.numtus=0
|
||||
self.wroteactions=False
|
||||
#get the startinglanguage name (e.g.: "EN-GB") from the program window
|
||||
self.startinglanguage=lang1
|
||||
#get the destinationlanguage name from the program window
|
||||
self.destinationlanguage=lang2
|
||||
try:
|
||||
self.errors=open(self.outputpath+os.sep+'_processing_info'+os.sep+self.startinglanguage+ '-'+self.destinationlanguage+'_'+'errors.txt','w+')
|
||||
except:
|
||||
pass
|
||||
self.statusBar.text='Language pair '+str(numcorpora)+' being processed. Please wait.'
|
||||
#Launch the segment extraction
|
||||
self.getallsegments()
|
||||
# if any error up to now, add the name of the TMX file to the output file @errors
|
||||
if self.errortypes:
|
||||
try:
|
||||
self.errors.write(self.presentfile.encode('utf_8','replace')+':\n'+self.errortypes.encode('utf_8','replace'))
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
self.errors.close()
|
||||
except:
|
||||
pass
|
||||
self.statusBar.text='Processing finished.'
|
||||
except:
|
||||
self.errortypes=self.errortypes+' - Extract All Corpora error\n'
|
||||
self.errors.write(self.presentfile.encode('utf_8','replace')+':\n'+self.errortypes.encode('utf_8','replace'))
|
||||
self.errors.close()
|
||||
#Open dialog box telling that processing is finished and where can the resulting files be found
|
||||
self.inputdir=''
|
||||
self.outputfile=''
|
||||
self.outputpath=''
|
||||
print 'Extract All Corpora: finished at '+strftime('%H-%M-%S')
|
||||
result = dialog.alertDialog(self, 'Results found in: '+ self.outputpath+'.', 'Processing done')
|
||||
|
||||
|
||||
def on_menuFileExtractAllCorpora_select(self, event):
|
||||
self.ExtractAllCorpora()
|
||||
def on_btnExtractAllCorpora_mouseClick(self, event):
|
||||
self.ExtractAllCorpora()
|
||||
|
||||
def ExtractSomeCorpora(self):
|
||||
"""Extracts the segments of the LanguagePairs indicated in the file "LanguagePairs.txt" located in the program's root directory
|
||||
|
||||
@self.presentfile: TMX file being currently processed
|
||||
@self.numtus: number of translation units extracted so far
|
||||
@currdir: current working directory of the program
|
||||
@pairsoflanguages: list of the pairs of language that are going to be processed
|
||||
@self.languages: list of languages whose segments can be processed
|
||||
@numcorpora: number of language pair being processed
|
||||
@self.inputdir: directory whose files will be treated
|
||||
@self.outputfile: base name of the resulting corpora files
|
||||
@self.errors:output file indicating the types of error that occurred in each processed TMX file
|
||||
@self.startinglanguage: something like 'EN-GB'
|
||||
@self.destinationlanguage: something like 'FR-FR'
|
||||
@lang1: code of the starting language
|
||||
@lang2: code of the destination language
|
||||
@self.errortypes: variable that stocks the types of errors detected in the TMX file that is being processed
|
||||
@self.wroteactions: variable that indicates whether the actions files has already been written to
|
||||
"""
|
||||
|
||||
print 'Extract Some Corpora: started at '+strftime('%H-%M-%S')
|
||||
self.presentfile=''
|
||||
self.numtus=0
|
||||
currdir=os.path.abspath(os.path.dirname(os.path.realpath(sys.argv[0])))
|
||||
#... load the file ("LanguageCodes.txt") with the list of languages that the program can process
|
||||
try:
|
||||
pairsoflanguages=open(currdir+os.sep+r'LanguagePairs.txt','r+').readlines()
|
||||
except:
|
||||
# If the languages file doesn't exist in the program directory, alert user that it is essential for the good working of the program and exit
|
||||
result = dialog.alertDialog(self, 'The file "LanguagePairs.txt" is missing. The program will now close.', 'Essential file missing')
|
||||
sys.exit()
|
||||
#remove end of line marker from each line in "LanguageCodes.txt"
|
||||
if pairsoflanguages:
|
||||
for item in range(len(pairsoflanguages)):
|
||||
pairsoflanguages[item]=pairsoflanguages[item].strip()
|
||||
pos=pairsoflanguages[item].find("/")
|
||||
pairsoflanguages[item]=(pairsoflanguages[item][:pos],pairsoflanguages[item][pos+1:])
|
||||
else:
|
||||
# If the languages file is empty, alert user that it is essential for the good working of the program and exit
|
||||
result = dialog.alertDialog(self, 'The file "LanguagePairs.txt" is an essential file and is empty. The program will now close.', 'Empty file')
|
||||
sys.exit()
|
||||
|
||||
#if the directory where TMX files (@inputdir) or the base name of the output files were not previously chosen, open a dialog box explaining
|
||||
#the conditions that have to be met so that the extraction can be made and do nothing...
|
||||
if (self.inputdir=='') or (self.outputfile==''):
|
||||
result = dialog.alertDialog(self, 'In order to extract all corpora, you need to:\n\n 1) indicate the directory where the TMX files are, and\n ' \
|
||||
+ '2) the base name of the output files.', 'Error')
|
||||
#...else, go ahead
|
||||
else:
|
||||
numcorpora=0
|
||||
for (lang1,lang2) in pairsoflanguages:
|
||||
if lang1<>lang2:
|
||||
print lang1+'/'+lang2+' corpus being created...'
|
||||
self.errortypes=''
|
||||
numcorpora=numcorpora+1
|
||||
#get the startinglanguage code (e.g.: "EN-GB")
|
||||
self.startinglanguage=lang1
|
||||
#get the destinationlanguage code
|
||||
self.destinationlanguage=lang2
|
||||
try:
|
||||
self.errors=open(self.outputpath+os.sep+'_processing_info'+os.sep+self.startinglanguage+ '-'+self.destinationlanguage+'_'+'errors.txt','w+')
|
||||
except:
|
||||
pass
|
||||
self.statusBar.text='Language pair '+str(numcorpora)+' being processed. Please wait.'
|
||||
#Launch the segment extraction
|
||||
self.numtus=0
|
||||
self.wroteactions=False
|
||||
self.getallsegments()
|
||||
# if any error up to now, add the name of the TMX file to the output file @errors
|
||||
if self.errortypes:
|
||||
try:
|
||||
self.errors.write(self.presentfile.encode('utf_8','replace')+':\n'+self.errortypes.encode('utf_8','replace'))
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
self.errors.close()
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
result = dialog.alertDialog(self, 'A bilingual corpus involves two different languages. The pair "'+lang1+'/'+lang2 + \
|
||||
'" will not be processed.', 'Alert')
|
||||
self.statusBar.text='Processing finished.'
|
||||
#Open dialog box telling that processing is finished and where can the resulting files be found
|
||||
self.inputdir=''
|
||||
self.outputfile=''
|
||||
self.outputpath=''
|
||||
print 'Extract Some Corpora: finished at '+strftime('%H-%M-%S')
|
||||
result = dialog.alertDialog(self, 'Results found in: '+ self.outputpath+'.', 'Processing done')
|
||||
|
||||
def on_menuFileExtractSomeCorpora_select(self, event):
|
||||
self.ExtractSomeCorpora()
|
||||
def on_btnExtractSomeCorpora_mouseClick(self, event):
|
||||
self.ExtractSomeCorpora()
|
||||
|
||||
def on_menuHelpHelp_select(self, event):
|
||||
try:
|
||||
f = open('_READ_ME_FIRST.txt', "r")
|
||||
msg = f.read()
|
||||
result = dialog.scrolledMessageDialog(self, msg, 'readme.txt')
|
||||
except:
|
||||
result = dialog.alertDialog(self, 'Help file missing', 'Problem with the Help file')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = model.Application(Extract_TMX_Corpus)
|
||||
app.MainLoop()
|
@ -1,141 +0,0 @@
|
||||
{'application':{'type':'Application',
|
||||
'name':'Extract_TMX_Corpus',
|
||||
'backgrounds': [
|
||||
{'type':'Background',
|
||||
'name':'bgExtract_TMX_Corpus',
|
||||
'title':u'Extract_TMX_Corpus',
|
||||
'size':(275, 410),
|
||||
'statusBar':1,
|
||||
|
||||
'menubar': {'type':'MenuBar',
|
||||
'menus': [
|
||||
{'type':'Menu',
|
||||
'name':'menuFile',
|
||||
'label':'&File',
|
||||
'items': [
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileSelectDirectory',
|
||||
'label':u'Select &input/output directory...\tCtrl+I',
|
||||
'command':'SelectListOfDirectories',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'menuGetOutputFileBaseName',
|
||||
'label':u'Get &output file base name...\tCtrl+O',
|
||||
'command':'GetOutputFileBaseName',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'fileSep1',
|
||||
'label':'-',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileExtractCorpus',
|
||||
'label':u'&Extract corpus\tCtrl+E',
|
||||
'command':'ExtractCorpus',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileExtractSomeCorpora',
|
||||
'label':u'Extract &some corpora\tCtrl+S',
|
||||
'command':'ExtractSomeCorpora',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileExtractAllCorpora',
|
||||
'label':u'Extract &all corpora\tCtrl+A',
|
||||
'command':'ExtractAllCorpora',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'fileSep2',
|
||||
'label':u'-',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileExit',
|
||||
'label':'E&xit\tAlt+X',
|
||||
'command':'Doexit',
|
||||
},
|
||||
]
|
||||
},
|
||||
{'type':'Menu',
|
||||
'name':'menuHelp',
|
||||
'label':u'&Help',
|
||||
'items': [
|
||||
{'type':'MenuItem',
|
||||
'name':'menuHelpHelp',
|
||||
'label':u'&Help...\tCtrl+H',
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
'components': [
|
||||
|
||||
{'type':'Button',
|
||||
'name':'btnExtractSomeCorpora',
|
||||
'position':(18, 267),
|
||||
'size':(225, 25),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'label':u'Extract some corpora',
|
||||
},
|
||||
|
||||
{'type':'Button',
|
||||
'name':'btnExtractAllCorpora',
|
||||
'position':(18, 233),
|
||||
'size':(225, 25),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'label':u'Extract all corpora',
|
||||
},
|
||||
|
||||
{'type':'StaticText',
|
||||
'name':'StaticText3',
|
||||
'position':(18, 107),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'text':u'Destination Language:',
|
||||
},
|
||||
|
||||
{'type':'ComboBox',
|
||||
'name':'cbDestinationLanguage',
|
||||
'position':(18, 129),
|
||||
'size':(225, -1),
|
||||
'items':[],
|
||||
},
|
||||
|
||||
{'type':'Button',
|
||||
'name':'btnSelectDirectory',
|
||||
'position':(18, 19),
|
||||
'size':(225, 25),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'label':u'Select input / output directory...',
|
||||
},
|
||||
|
||||
{'type':'ComboBox',
|
||||
'name':'cbStartingLanguage',
|
||||
'position':(18, 74),
|
||||
'size':(225, -1),
|
||||
'items':[u'DE-PT', u'EN-PT', u'ES-PT', u'FR-PT'],
|
||||
},
|
||||
|
||||
{'type':'Button',
|
||||
'name':'btnGetOutputFileBaseName',
|
||||
'position':(18, 166),
|
||||
'size':(225, 25),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'label':u'Select base name of output file...',
|
||||
},
|
||||
|
||||
{'type':'Button',
|
||||
'name':'btnExtractCorpus',
|
||||
'position':(18, 200),
|
||||
'size':(225, 25),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'label':u'Extract one corpus',
|
||||
},
|
||||
|
||||
{'type':'StaticText',
|
||||
'name':'StaticText1',
|
||||
'position':(18, 53),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'text':u'Starting Language:',
|
||||
},
|
||||
|
||||
] # end components
|
||||
} # end background
|
||||
] # end backgrounds
|
||||
} }
|
@ -1,22 +0,0 @@
|
||||
BG-01
|
||||
CS-01
|
||||
DA-01
|
||||
DE-DE
|
||||
EL-01
|
||||
EN-GB
|
||||
ES-ES
|
||||
ET-01
|
||||
FI-01
|
||||
FR-FR
|
||||
HU-01
|
||||
IT-IT
|
||||
LT-01
|
||||
LV-01
|
||||
MT-01
|
||||
NL-NL
|
||||
PL-01
|
||||
PT-PT
|
||||
RO-RO
|
||||
SK-01
|
||||
SL-01
|
||||
SV-SE
|
@ -1,3 +0,0 @@
|
||||
BG-01/CS-01
|
||||
FR-FR/PT-PT
|
||||
EN-GB/LT-01
|
@ -1,241 +0,0 @@
|
||||
Summary:
|
||||
PURPOSE
|
||||
PERFORMANCE
|
||||
REQUIREMENTS
|
||||
INSTALLATION
|
||||
HOW TO USE
|
||||
GETTING THE RESULTS
|
||||
THANKS
|
||||
LICENSE
|
||||
|
||||
|
||||
********************************************************************************
|
||||
PURPOSE:
|
||||
********************************************************************************
|
||||
This is the MS Windows and Linux version (tested with Ubuntu 10.10 and 11.04)
|
||||
of Extract_Tmx_Corpus_1.044.
|
||||
|
||||
Extract_Tmx_Corpus_1.044 was created initially as a Windows program (tested in
|
||||
Windows 7, Vista and XP) with a view to enable translators not necessarily with
|
||||
a deep knowledge of linguistic tools to create highly customised corpora that
|
||||
can be used with the Moses machine translation system and with other systems.
|
||||
Some users call it "et cetera", playing a bit with its initials (ETC) and
|
||||
meaning that it can treat a never-ending number of files.
|
||||
|
||||
In order to create corpora that are most useful to train machine translation
|
||||
systems, one should strive to include segments that are relevant for the task in
|
||||
hand. One of the ways of finding such segments could involve the usage of
|
||||
previous translation memory files (TMX files). This way the corpora could be
|
||||
customised for the person or for the type of task in question. The present
|
||||
program uses such files as input.
|
||||
|
||||
The program can create strictly aligned corpora for a single pair of languages,
|
||||
several pairs of languages or all the pairs of languages contained in the TMX
|
||||
files.
|
||||
|
||||
The program creates 2 separate files (UTF-8 format; Unix line endings) for each
|
||||
language pair that it processes: one for the starting language and another for
|
||||
the destination language. The lines of a given TMX translation unit are placed
|
||||
in strictly the same line in both files. The program suppresses empty TMX
|
||||
translation units, as well as those where the text for the first language is the
|
||||
same as that of the second language (like translation units consisting solely of
|
||||
numbers, or those in which the first language segment has not been translated
|
||||
into the second language). If you are interested in another format of corpus, it
|
||||
should be relatively easy to adapt this format to the format you are interested
|
||||
in.
|
||||
|
||||
The program also informs about errors that might occur during processing and
|
||||
creates a file that lists the name(s) of the TMX files that caused them, as well
|
||||
as a separate one listing the files successfully treated and the number of
|
||||
segments extracted for the language pair.
|
||||
|
||||
********************************************************************************
|
||||
REQUIREMENTS:
|
||||
********************************************************************************
|
||||
The program requires the following to be pre-installed in your computer:
|
||||
|
||||
1) Python 2.5 or higher (The program has been tested on Python 2.5 to 2.7.)
|
||||
Windows users download and install from http://www.python.org/download/
|
||||
Ubuntu users can use the pre-installed Python distribution
|
||||
|
||||
2) wxPython 2.8 or higher
|
||||
Windows users download and install the Unicode version from
|
||||
http://www.wxpython.org/download.php
|
||||
Ubuntu users install with:
|
||||
sudo apt-get install python-wxtools
|
||||
|
||||
3) Pythoncard 0.8.2 or higher
|
||||
Windows users download and install
|
||||
http://sourceforge.net/projects/pythoncard/files/PythonCard/0.8.2/PythonCard-0.8.2.win32.exe/download
|
||||
Ubuntu/Debian users install with:
|
||||
sudo apt-get install pythoncard
|
||||
|
||||
********************************************************************************
|
||||
INSTALLATION:
|
||||
********************************************************************************
|
||||
Windows users:
|
||||
1) Download the Extract_TMX_Corpus_1.041.exe file
|
||||
2) Double-click Extract_TMX_Corpus_1.041.exe and follow the wizard's
|
||||
instructions.
|
||||
NOTE: Windows Vista users, to run the installation programs, by right-click on
|
||||
the installation file in Windows Explorer and choose "Execute as administrator"
|
||||
in the contextual menu.
|
||||
|
||||
Ubuntu users:
|
||||
1) Download the Moses2TMX.tgz compressed file to a directory of your choice.
|
||||
2) Expand the compressed file and run from the expanded directory.
|
||||
|
||||
***IMPORTANT***: Never erase the file "LanguageCodes.txt" in that directory. It
|
||||
is necessary for telling the program the languages that it has to process. If
|
||||
your TMX files use language codes that are different from those contained in
|
||||
this file, please replace the codes contained in the file with the codes used in
|
||||
your TMX files. You can always add or delete new codes to this file (when the
|
||||
program is not running).
|
||||
|
||||
********************************************************************************
|
||||
HOW TO USE:
|
||||
********************************************************************************
|
||||
1) Create a directory where you will copy the TMX files that you want to
|
||||
process.
|
||||
|
||||
2) Copy the TMX files to that directory.
|
||||
Note: If you do not have TMX files, try the following site:
|
||||
http://langtech.jrc.it/DGT-TM.html#Download. It contains the European Union
|
||||
DGT's Translation Memory, containing legislative documents of the European
|
||||
Union. For more details, see http://wt.jrc.it/lt/Acquis/DGT_TU_1.0/data/. These
|
||||
files are compressed in zip format and need to be unzipped before they can be
|
||||
used.
|
||||
|
||||
3) Launch the program.
|
||||
|
||||
4) Operate on the main window of the program in the direction from top to
|
||||
bottom:
|
||||
|
||||
a) Click the "Select input/output directory" button to tell the root
|
||||
directory where the TMX files are (this directory can have subdirectories,
|
||||
all of which will also be processed), as well as where the output files
|
||||
produced by the program will be placed;
|
||||
NOTE: Please take note of this directory because the result files will also
|
||||
be placed there.
|
||||
|
||||
b) In case you want to extract a ***single*** pair of languages, choose them
|
||||
in the "Starting Language" and "Destination Language" comboboxes. Do nothing
|
||||
if you want to extract more than one pair of languages.
|
||||
|
||||
c) Click the "Select base name of output file" button and choose a base name
|
||||
for the output files (default: "Corpus.txt").
|
||||
Note: This base name is used to compose the names of the output files, which
|
||||
will also include the names of the starting and destination languages. If
|
||||
you accept the default "Corpus.txt" and choose "EN-GB" as starting language
|
||||
and "PT-PT" as destination language, for that corpus pair the respective
|
||||
corpora files will be named, respectively, "EN-GB (PT-PT)_Corpus.txt" and
|
||||
"PT-PT (EN-GB)_Corpus.txt".
|
||||
***TIP***: The base name is useful for getting different names for different
|
||||
corpora of the same language.
|
||||
|
||||
d) Click one (***just one***) of the following buttons:
|
||||
- "Extract one corpus": this creates a single pair of strictly aligned
|
||||
corpora in the languages chosen in the "Starting Language" and
|
||||
"Destination Language" comboboxes;
|
||||
- "Extract all corpora": this extracts all the combination pairs of
|
||||
languages for all the languages available in the "Starting Language" and
|
||||
"Destination language" comboboxes; if a language pair does not have
|
||||
segments of both languages in all of the translation units of all the
|
||||
TMX files, the result will be two empty corpora files for that language
|
||||
pair. If, however, there is just a single relevant translation unit, the
|
||||
corpus won't be empty.
|
||||
- "Extract some corpora": this extracts the pairs of languages listed in
|
||||
the file "LanguagePairs.txt". Each line of this file has the following
|
||||
structure:
|
||||
{Starting Language}/{Destination Language}.
|
||||
|
||||
Here is an example of a file with 2 lines:
|
||||
|
||||
EN-GB/PT-PT
|
||||
FR-FR/PT-PT
|
||||
|
||||
This will create corpora for 4 pairs of languages: EN-PT, PT-EN and FR-PT and
|
||||
PT-FR. A sample "LanguagePairs.txt" comes with the program to serve as an
|
||||
example. Customise it to your needs respecting the syntax described above.
|
||||
|
||||
NOTE: Never erase the "LanguagePairs.txt" file and always make sure that each
|
||||
pair of languages that you choose does exist in your TMX files. Otherwise, you
|
||||
won't get any results.
|
||||
|
||||
The "Extract some corpora" and "Extract all corpora" functions are particularly
|
||||
useful if you want to prepare corpora for several or many language pairs. If
|
||||
your TMX files have translation units in all of the languages you are interested
|
||||
in, put them in a single directory (it can have subdirectories) and use those
|
||||
functions!
|
||||
|
||||
********************************************************************************
|
||||
GETTING THE RESULTS:
|
||||
********************************************************************************
|
||||
The results are the aligned corpora files, as well as other files indicating how
|
||||
well the processing was done.
|
||||
|
||||
When the processing is finished, you will find the corpora files in the
|
||||
directory you have chosen when you selected "Select input/output directory". In
|
||||
the "_processing_info" subdirectory of that directory you will find one or more
|
||||
*errors.txt file(s), listing the name of the TMX files that caused an error, and
|
||||
*actions.txt file(s), listing the files that were successfully processed as well
|
||||
as the number of translation units extracted.
|
||||
|
||||
If you ask for the extraction of several corpora at once, you'll get lots of
|
||||
corpora files. If you feel somewhat confused by that abundance, please note 2
|
||||
things:
|
||||
a) If you sort the files by order of modified date, you'll reconstitute the
|
||||
chronological order in which the corpora were made (corpora are always made in
|
||||
pairs one after the other);
|
||||
b) The name of the corpora file has the following structure:
|
||||
|
||||
{Language of the segments} ({Language with which they are aligned})_{Base name
|
||||
of the corpus}.txt
|
||||
Example: the file "BG-01 (MT-01)_Corpus.txt" has segments in the BG-01
|
||||
(Bulgarian) language that also have a translation in the MT-01 (Maltese)
|
||||
language and corresponds to the corpus whose base name is "Corpus.txt". There
|
||||
should be an equivalent "MT-01 (BG-01)_Corpus.txt", this time with all the
|
||||
Maltese segments that have a translation in Bulgarian. Together, these 2 files
|
||||
constitute an aligned corpus ready to be fed to Moses.
|
||||
|
||||
You can now feed Moses your customised corpora :-)
|
||||
|
||||
********************************************************************************
|
||||
PERFORMANCE:
|
||||
********************************************************************************
|
||||
The program can process very large numbers of TMX files (tens of thousands or
|
||||
more). It can also process extremely big TMX files (500 MB or more; it
|
||||
successfully processed a 2,3 GB file). The extraction of the corpus of a pair of
|
||||
languages in a very large (6,15 GB) set of TMX files took approximately 45
|
||||
minutes in an Intel Core 2 Solo U3500 computer @ 1.4 GHz with 4 GB RAM.
|
||||
|
||||
The starting language and the destination language segments can be in any order
|
||||
in the TMX files (e.g., the starting language segment may be found either before
|
||||
or after the destination language segment in one, several or all translation
|
||||
units of the TMX file).
|
||||
|
||||
The program accepts and preserves text in any language (including special
|
||||
diacritical characters), but has only been tested with European Union official
|
||||
languages.
|
||||
|
||||
********************************************************************************
|
||||
THANKS:
|
||||
********************************************************************************
|
||||
Thanks to Gary Daine, who pointed out a way to improve one of the regex
|
||||
expressions used in the code.
|
||||
|
||||
********************************************************************************
|
||||
LICENSE:
|
||||
********************************************************************************
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation (version 3 of the License).
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
@ -1,22 +0,0 @@
|
||||
BG-01
|
||||
CS-01
|
||||
DA-01
|
||||
DE-DE
|
||||
EL-01
|
||||
EN-GB
|
||||
ES-ES
|
||||
ET-01
|
||||
FI-01
|
||||
FR-FR
|
||||
HU-01
|
||||
IT-IT
|
||||
LT-01
|
||||
LV-01
|
||||
MT-01
|
||||
NL-NL
|
||||
PL-01
|
||||
PT-PT
|
||||
RO-RO
|
||||
SK-01
|
||||
SL-01
|
||||
SV-SE
|
@ -1,166 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
# -*- coding: utf_8 -*-
|
||||
"""This program is used to prepare TMX files from corpora composed of 2 files for each language pair,
|
||||
where the position of a segment in the first language file is exactly the same as in the second
|
||||
language file.
|
||||
|
||||
The program requires that Pythoncard and wxPython (as well as Python) be previously installed.
|
||||
|
||||
Copyright 2009, 2010 João Luís A. C. Rosas
|
||||
|
||||
Distributed under GNU GPL v3 licence (see http://www.gnu.org/licenses/)
|
||||
|
||||
E-mail: joao.luis.rosas@gmail.com """
|
||||
|
||||
__version__ = "$Revision: 1.033$"
|
||||
__date__ = "$Date: 2010/02/25$"
|
||||
__author__="$João Luís A. C. Rosas$"
|
||||
|
||||
from PythonCard import clipboard, dialog, graphic, model
|
||||
from PythonCard.components import button, combobox,statictext,checkbox,staticbox
|
||||
import wx
|
||||
import os, re
|
||||
import string
|
||||
import sys
|
||||
from time import strftime
|
||||
import codecs
|
||||
|
||||
class Moses2TMX(model.Background):
|
||||
|
||||
def on_initialize(self, event):
|
||||
self.inputdir=''
|
||||
#Get directory where program file is and ...
|
||||
currdir=os.path.abspath(os.path.dirname(os.path.realpath(sys.argv[0])))
|
||||
#... load the file ("LanguageCodes.txt") with the list of languages that the program can process
|
||||
try:
|
||||
self.languages=open(currdir+os.sep+r'LanguageCodes.txt','r+').readlines()
|
||||
except:
|
||||
# If the languages file doesn't exist in the program directory, alert user that it is essential for the good working of the program and exit
|
||||
result = dialog.alertDialog(self, 'The file "LanguageCodes.txt" is missing. The program will now close.', 'Essential file missing')
|
||||
sys.exit()
|
||||
#remove end of line marker from each line in "LanguageCodes.txt"
|
||||
for lang in range(len(self.languages)):
|
||||
self.languages[lang]=self.languages[lang].rstrip()
|
||||
self.lang1code=''
|
||||
self.lang2code=''
|
||||
#Insert list of language names in appropriate program window's combo boxes
|
||||
self.components.cbStartingLanguage.items=self.languages
|
||||
self.components.cbDestinationLanguage.items=self.languages
|
||||
|
||||
def CreateTMX(self, name):
|
||||
print 'Started at '+strftime('%H-%M-%S')
|
||||
#get the startinglanguage name (e.g.: "EN-GB") from the program window
|
||||
self.lang1code=self.components.cbStartingLanguage.text
|
||||
#get the destinationlanguage name from the program window
|
||||
self.lang2code=self.components.cbDestinationLanguage.text
|
||||
print name+'.'+self.lang2code[:2].lower()
|
||||
e=codecs.open(name,'r',"utf-8","strict")
|
||||
f=codecs.open(name+'.'+self.lang2code[:2].lower()+'.moses','r',"utf-8","strict")
|
||||
a=codecs.open(name+'.tmp','w',"utf-8","strict")
|
||||
b=codecs.open(name+'.'+self.lang2code[:2].lower()+'.moses.tmp','w',"utf-8","strict")
|
||||
for line in e:
|
||||
if line.strip():
|
||||
a.write(line)
|
||||
for line in f:
|
||||
if line.strip():
|
||||
b.write(line)
|
||||
a=codecs.open(name+'.tmp','r',"utf-8","strict")
|
||||
b=codecs.open(name+'.'+self.lang2code[:2].lower()+'.moses.tmp','r',"utf-8","strict")
|
||||
g=codecs.open(name+'.tmx','w','utf-16','strict')
|
||||
g.write('<?xml version="1.0" ?>\n<!DOCTYPE tmx SYSTEM "tmx14.dtd">\n<tmx version="version 1.4">\n\n<header\ncreationtool="moses2tmx"\ncreationtoolversion="1.032"\nsegtype="sentence"\ndatatype="PlainText"\nadminlang="EN-US"\nsrclang="'+self.lang1code+'"\n>\n</header>\n\n<body>\n')
|
||||
parar=0
|
||||
while True:
|
||||
self.ling1segm=a.readline().strip()
|
||||
self.ling2segm=b.readline().strip()
|
||||
if not self.ling1segm:
|
||||
break
|
||||
elif not self.ling2segm:
|
||||
break
|
||||
else:
|
||||
try:
|
||||
g.write('<tu creationid="MT!">\n<prop type="Txt::Translator">Moses</prop>\n<tuv xml:lang="'+self.lang1code+'">\n<seg>'+self.ling1segm+'</seg>\n</tuv>\n<tuv xml:lang="'+self.lang2code+ \
|
||||
'">\n<seg>'+self.ling2segm+'</seg>\n</tuv>\n</tu>\n\n')
|
||||
except:
|
||||
pass
|
||||
a.close()
|
||||
b.close()
|
||||
e.close()
|
||||
f.close()
|
||||
g.write('</body>\n</tmx>\n')
|
||||
g.close()
|
||||
#os.remove(name)
|
||||
#os.remove(name+'.'+self.lang2code[:2].lower()+'.moses')
|
||||
os.remove(name+'.tmp')
|
||||
os.remove(name+'.'+self.lang2code[:2].lower()+'.moses.tmp')
|
||||
|
||||
def createTMXs(self):
|
||||
try:
|
||||
# Get a list of all TMX files that need to be processed
|
||||
fileslist=self.locate('*.moses',self.inputdir)
|
||||
except:
|
||||
# if any error up to now, add the name of the TMX file to the output file @errors
|
||||
self.errortypes=self.errortypes+' - Get All Segments: creation of output files error\n'
|
||||
if fileslist:
|
||||
# For each relevant TMX file ...
|
||||
for self.presentfile in fileslist:
|
||||
filename=self.presentfile[:-9]
|
||||
#print filename
|
||||
self.CreateTMX(filename)
|
||||
print 'Finished at '+strftime('%H-%M-%S')
|
||||
result = dialog.alertDialog(self, 'Processing done.', 'Processing Done')
|
||||
|
||||
def on_btnCreateTMX_mouseClick(self, event):
|
||||
self.createTMXs()
|
||||
|
||||
def on_menuFileCreateTMXFiles_select(self, event):
|
||||
self.createTMXs()
|
||||
|
||||
def on_btnSelectLang1File_mouseClick(self, event):
|
||||
self.input1=self.GetInputFileName()
|
||||
|
||||
def on_btnSelectLang2File_mouseClick(self, event):
|
||||
self.input2=self.GetInputFileName()
|
||||
|
||||
def locate(self,pattern, basedir):
|
||||
"""Locate all files matching supplied filename pattern in and below
|
||||
supplied root directory.
|
||||
|
||||
@pattern: something like '*.tmx'
|
||||
@basedir:whole directory to be treated
|
||||
"""
|
||||
import fnmatch
|
||||
for path, dirs, files in os.walk(os.path.abspath(basedir)):
|
||||
for filename in fnmatch.filter(files, pattern):
|
||||
yield os.path.join(path, filename)
|
||||
|
||||
def SelectDirectory(self):
|
||||
"""Select the directory where the files to be processed are
|
||||
|
||||
@result: object returned by the dialog window with attributes accepted (true if user clicked OK button, false otherwise) and
|
||||
path (list of strings containing the full pathnames to all files selected by the user)
|
||||
@self.inputdir: directory where files to be processed are (and where output files will be written)
|
||||
@self.statusBar.text: text displayed in the program window status bar"""
|
||||
|
||||
result= dialog.directoryDialog(self, 'Choose a directory', 'a')
|
||||
if result.accepted:
|
||||
self.inputdir=result.path
|
||||
self.statusBar.text=self.inputdir+' selected.'
|
||||
|
||||
def on_menuFileSelectDirectory_select(self, event):
|
||||
self.SelectDirectory()
|
||||
|
||||
def on_btnSelectDirectory_mouseClick(self, event):
|
||||
self.SelectDirectory()
|
||||
|
||||
def on_menuHelpShowHelp_select(self, event):
|
||||
f = open('_READ_ME_FIRST.txt', "r")
|
||||
msg = f.read()
|
||||
result = dialog.scrolledMessageDialog(self, msg, '_READ_ME_FIRST.txt')
|
||||
|
||||
def on_menuFileExit_select(self, event):
|
||||
sys.exit()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = model.Application(Moses2TMX)
|
||||
app.MainLoop()
|
@ -1,95 +0,0 @@
|
||||
{'application':{'type':'Application',
|
||||
'name':'Moses2TMX',
|
||||
'backgrounds': [
|
||||
{'type':'Background',
|
||||
'name':'bgMoses2TMX',
|
||||
'title':u'Moses2TMX-1.032',
|
||||
'size':(277, 307),
|
||||
'statusBar':1,
|
||||
|
||||
'menubar': {'type':'MenuBar',
|
||||
'menus': [
|
||||
{'type':'Menu',
|
||||
'name':'menuFile',
|
||||
'label':u'&File',
|
||||
'items': [
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileSelectDirectory',
|
||||
'label':u'Select &Directory ...\tAlt+D',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileCreateTMXFiles',
|
||||
'label':u'&Create TMX Files\tAlt+C',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'Sep1',
|
||||
'label':u'-',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileExit',
|
||||
'label':u'&Exit\tAlt+E',
|
||||
},
|
||||
]
|
||||
},
|
||||
{'type':'Menu',
|
||||
'name':'menuHelp',
|
||||
'label':u'&Help',
|
||||
'items': [
|
||||
{'type':'MenuItem',
|
||||
'name':'menuHelpShowHelp',
|
||||
'label':u'&Show Help\tAlt+S',
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
'components': [
|
||||
|
||||
{'type':'Button',
|
||||
'name':'btnSelectDirectory',
|
||||
'position':(15, 15),
|
||||
'size':(225, 25),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'label':u'Select Directory ...',
|
||||
},
|
||||
|
||||
{'type':'StaticText',
|
||||
'name':'StaticText3',
|
||||
'position':(17, 106),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'text':u'Target Language:',
|
||||
},
|
||||
|
||||
{'type':'ComboBox',
|
||||
'name':'cbStartingLanguage',
|
||||
'position':(18, 75),
|
||||
'size':(70, -1),
|
||||
'items':[],
|
||||
},
|
||||
|
||||
{'type':'ComboBox',
|
||||
'name':'cbDestinationLanguage',
|
||||
'position':(17, 123),
|
||||
'size':(70, -1),
|
||||
'items':[u'DE-PT', u'EN-PT', u'ES-PT', u'FR-PT'],
|
||||
},
|
||||
|
||||
{'type':'Button',
|
||||
'name':'btnCreateTMX',
|
||||
'position':(20, 160),
|
||||
'size':(225, 25),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'label':u'Create TMX Files',
|
||||
},
|
||||
|
||||
{'type':'StaticText',
|
||||
'name':'StaticText1',
|
||||
'position':(18, 56),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'text':u'Source Language:',
|
||||
},
|
||||
|
||||
] # end components
|
||||
} # end background
|
||||
] # end backgrounds
|
||||
} }
|
@ -1,127 +0,0 @@
|
||||
Summary:
|
||||
PURPOSE
|
||||
REQUIREMENTS
|
||||
INSTALLATION
|
||||
HOW TO USE
|
||||
LICENSE
|
||||
|
||||
|
||||
********************************************************************************
|
||||
PURPOSE:
|
||||
********************************************************************************
|
||||
This is the MS Windows and Linux version (tested with Ubuntu 10.10 and 11.04) of
|
||||
Moses2TMX 1.033.
|
||||
|
||||
Moses2TMX started as a Windows program (tested on Windows7, Vista and XP) that
|
||||
enables translators not necessarily with a deep knowledge of linguistic tools to
|
||||
create TMX files from a Moses corpus or from any other corpus made up of 2
|
||||
separate files, one for the source language and another for the target language,
|
||||
whose lines are strictly aligned.
|
||||
|
||||
The program processes a whole directory containing source language and
|
||||
corresponding target language documents and creates 1 TMX file (UTF-16 format;
|
||||
Windows line endings) for each document pair that it processes.
|
||||
|
||||
The program accepts and preserves text in any language (including special
|
||||
diacritical characters), but has only been tested with European Union official
|
||||
languages.
|
||||
|
||||
The program is specifically intended to work with the output of a series of
|
||||
Linux scripts together called Moses-for-Mere-Mortals.
|
||||
|
||||
********************************************************************************
|
||||
REQUIREMENTS:
|
||||
********************************************************************************
|
||||
The program requires the following to be pre-installed in your computer:
|
||||
|
||||
1) Python 2.5 or higher (The program has been tested on Python 2.5 to 2.7)
|
||||
Windows users download and install from http://www.python.org/download/
|
||||
Ubuntu users can use the pre-installed Python distribution
|
||||
|
||||
2) wxPython 2.8 or higher
|
||||
Windows users download and install the Unicode version from
|
||||
http://www.wxpython.org/download.php
|
||||
Ubuntu users install with: sudo apt-get install python-wxtools
|
||||
|
||||
3) Pythoncard 0.8.2 or higher
|
||||
Windows users download and install
|
||||
http://sourceforge.net/projects/pythoncard/files/PythonCard/0.8.2/PythonCard-0.8.2.win32.exe/download
|
||||
Ubuntu users install with: sudo apt-get install pythoncard
|
||||
|
||||
********************************************************************************
|
||||
INSTALLATION:
|
||||
********************************************************************************
|
||||
Windows users:
|
||||
1) Download the Moses2TMX.exe file to a directory of your choice.
|
||||
2) Double-click Moses2TMX.exe and follow the wizard's instructions.
|
||||
NOTE: Windows Vista users, to run the installation programs, by right-click on
|
||||
the installation file in Windows Explorer and choose "Execute as administrator"
|
||||
in the contextual menu.
|
||||
|
||||
Ubuntu users:
|
||||
1) Download the Moses2TMX.tgz compressed file to a directory of your choice.
|
||||
2) Expand the compressed file and run from the expanded directory.
|
||||
|
||||
***IMPORTANT***: Never erase the file "LanguageCodes.txt" in that directory. It
|
||||
is necessary for telling the program the languages that it has to process. If
|
||||
your TMX files use language codes that are different from those contained in
|
||||
this file, please replace the codes contained in the file with the codes used in
|
||||
your TMX files. You can always add or delete new codes to this file (when the
|
||||
program is not running).
|
||||
|
||||
********************************************************************************
|
||||
HOW TO USE:
|
||||
********************************************************************************
|
||||
1) Create a directory where you will copy the files that you want to process.
|
||||
|
||||
2) Copy the source and target language documents that you want to process to
|
||||
that directory.
|
||||
NOTE YOU HAVE TO RESPECT SOME NAMING CONVENTIONS IN ORDER TO BE ABLE TO USE
|
||||
THIS PROGRAM:
|
||||
|
||||
a) the target documents have to have follow the following convention:
|
||||
|
||||
{basename}.{abbreviation of target language}.moses
|
||||
|
||||
where {abbreviation of target language} is a ***2 character*** string
|
||||
containing the lowercased first 2 characters of any of the language
|
||||
codes present in the LanguageCodes.txt (present in the base directory of
|
||||
Moses2TMX)
|
||||
|
||||
Example: If {basename} = "200000" and the target language has a code
|
||||
"EN-GB" in the LanguageCodes.txt, then the name of the target file
|
||||
should be "200000.en.moses"
|
||||
|
||||
b) the source language document should have the name:
|
||||
|
||||
{basename}
|
||||
|
||||
Example: continuing the preceding example, the name of the corresponding
|
||||
source document should be "200000".
|
||||
|
||||
3) Launch the program as indicated above in the "Launching the program" section.
|
||||
|
||||
4) Operate on the main window of the program in the direction from top to
|
||||
bottom:
|
||||
a) Click the "Select Directory..." button to indicate the directory
|
||||
containing all the source and corresponding target documents that you want
|
||||
to process;
|
||||
b) Indicate the languages of your files refers to in the "Source Language"
|
||||
and "Target Language" comboboxes;
|
||||
c) Click the Create TMX Files button.
|
||||
|
||||
********************************************************************************
|
||||
LICENSE:
|
||||
********************************************************************************
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation (version 3 of the License).
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
129
contrib/iSenWeb/index.html
Executable file
@ -0,0 +1,129 @@
|
||||
<!DOCTYPE html>
|
||||
<HTML>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Moses Translation System</title>
|
||||
<script type="text/javascript" src="jquery-1.7.2.js"></script>
|
||||
<link href="./themes/styles/common.css" rel="stylesheet" type="text/css" />
|
||||
<link href="./themes/styles/search.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="./themes/styles/fanyi.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<script language="javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
||||
var targetDiv = $("#outputText");
|
||||
var input = $("#inputText");
|
||||
|
||||
$("#transForm").submit(function()
|
||||
{
|
||||
$.ajax(
|
||||
{
|
||||
type: "POST", url: 'trans_result.php',data: {input1: input.val()},
|
||||
complete: function(data)
|
||||
{
|
||||
targetDiv.html('');
|
||||
targetDiv.append(data.responseText);
|
||||
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<body>
|
||||
<div class="topWrap">
|
||||
<div class="top">
|
||||
<div class="logo"><a href="/" title="English Chinese Translation Based on Moses">Home</a></div>
|
||||
|
||||
</div>
|
||||
<!-- top end -->
|
||||
</div>
|
||||
<div class="ConBox">
|
||||
<div class="hd">
|
||||
<div id="inputMod" class="column fl">
|
||||
<div class="wrapper">
|
||||
<!--
|
||||
<form action="trans_result.php" method="post" id="transForm" name="transForm">-->
|
||||
<form action="" method="post" id="transForm" name="transForm">
|
||||
<div class="row desc">
|
||||
Source Text:
|
||||
<input type="reset" name="clear" value="Clear"/>
|
||||
</div>
|
||||
<div class="row border content">
|
||||
<textarea id="inputText" class="text" dir="ltr" tabindex="1" wrap="SOFT" name="inputText"></textarea>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<select>
|
||||
<option value ="en-cn">English >> Chinese </option>
|
||||
</select>
|
||||
<input type="submit" value="Translation"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- end of wrapper -->
|
||||
</div>
|
||||
<!-- end of div inputMod -->
|
||||
<div id="outputMod" class="column fr">
|
||||
<div class="wrapper">
|
||||
<div id="translated" style="display: block;">
|
||||
<div class="row desc"><span id="outputLang">en->ch</span></div>
|
||||
<div class="row">
|
||||
<div id="outputText" class="row">
|
||||
<div class="translated_result">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- end of entryList -->
|
||||
<!-- end translated -->
|
||||
</div>
|
||||
<!-- end of wrapper -->
|
||||
|
||||
|
||||
<div class="row cf" id="addons">
|
||||
<a id="feedback_link" target="_blank" href="#" class="fr">Feedback</a>
|
||||
<span id="suggestYou">
|
||||
选择<a data-pos="web.o.leftbottom" class="clog-js" data-clog="FUFEI_CLICK" href="http://nlp2ct.sftw.umac.mo/" target="_blank">人工翻译服务</a>,获得更专业的翻译结果。
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="errorHolder"><span class="error_text"></span></div>
|
||||
</div>
|
||||
<div style="clear:both"></div>
|
||||
<script type="text/javascript">
|
||||
var global = {};
|
||||
global.sessionFrom = "http://dict.youdao.com/";
|
||||
</script>
|
||||
<script type="text/javascript" src="http://impservice.dictweb.youdao.com/imp/dict_req_web_1.0.js"></script>
|
||||
<script data-main="fanyi" type="text/javascript" src="./themes/fanyi/v2.1.3.1/scripts/fanyi.js"></script>
|
||||
<div id="transBtnTip">
|
||||
<div id="transBtnTipInner">
|
||||
点击翻译按钮继续,查看网页翻译结果。
|
||||
<p class="ar">
|
||||
<a href="#" id="transBtnTipOK">I have known</a>
|
||||
</p>
|
||||
<b id="transBtnTipArrow"></b>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Feedback"><a href="http://nlp2ct.sftw.umac.mo/" target="_blank">反馈信息给我们</a></div>
|
||||
|
||||
|
||||
<div class="footer" style="clear:both">
|
||||
<p><a href="http://nlp2ct.sftw.umac.mo/" target="_blank">Conect with us</a> <span>|</span>
|
||||
<a href="http://nlp2ct.sftw.umac.mo/" target="_blank">Mosese Translated system</a> <span>|</span>
|
||||
Copyright© 2012-2012 NLP2CT All Right to Moses Group
|
||||
</p>
|
||||
<p>More</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</HTML>
|
9405
contrib/iSenWeb/jquery-1.7.2.js
vendored
Executable file
59
contrib/iSenWeb/moses.pl
Executable file
@ -0,0 +1,59 @@
|
||||
#!/usr/bin/perl -w
|
||||
use warnings;
|
||||
use strict;
|
||||
$|++;
|
||||
|
||||
# file: daemon.pl
|
||||
|
||||
# Herve Saint-Amand
|
||||
# Universitaet des Saarlandes
|
||||
# Tue May 13 19:45:31 2008
|
||||
|
||||
# This script starts Moses to run in the background, so that it can be used by
|
||||
# the CGI script. It spawns the Moses process, then binds itself to listen on
|
||||
# some port, and when it gets a connection, reads it line by line, feeds those
|
||||
# to Moses, and sends back the translation.
|
||||
|
||||
# You can either run one instance of this on your Web server, or, if you have
|
||||
# the hardware setup for it, run several instances of this, then configure
|
||||
# translate.cgi to connect to these.
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# includes
|
||||
|
||||
use IO::Socket::INET;
|
||||
use IPC::Open2;
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# constants, global vars, config
|
||||
|
||||
my $MOSES = '/home/tianliang/research/moses-smt/scripts/training/model/moses';
|
||||
my $MOSES_INI = '/home/tianliang/research/moses-smt/scripts/training/model/moses.ini';
|
||||
|
||||
die "usage: daemon.pl <hostname> <port>" unless (@ARGV == 2);
|
||||
my $LISTEN_HOST = shift;
|
||||
my $LISTEN_PORT = shift;
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# main
|
||||
|
||||
# spawn moses
|
||||
my ($MOSES_IN, $MOSES_OUT);
|
||||
my $pid = open2 ($MOSES_OUT, $MOSES_IN, $MOSES, '-f', $MOSES_INI);
|
||||
|
||||
# open server socket
|
||||
my $server_sock = new IO::Socket::INET
|
||||
(LocalAddr => $LISTEN_HOST, LocalPort => $LISTEN_PORT, Listen => 1)
|
||||
|| die "Can't bind server socket";
|
||||
|
||||
while (my $client_sock = $server_sock->accept) {
|
||||
while (my $line = <$client_sock>) {
|
||||
print $MOSES_IN $line;
|
||||
$MOSES_IN->flush ();
|
||||
print $client_sock scalar <$MOSES_OUT>;
|
||||
}
|
||||
|
||||
$client_sock->close ();
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
BIN
contrib/iSenWeb/themes/images/common/Logo (1000x300).png
Executable file
After Width: | Height: | Size: 53 KiB |
BIN
contrib/iSenWeb/themes/images/common/Logo (2000x2000).png
Executable file
After Width: | Height: | Size: 266 KiB |
BIN
contrib/iSenWeb/themes/images/common/Logo (250x250).png
Executable file
After Width: | Height: | Size: 23 KiB |
BIN
contrib/iSenWeb/themes/images/common/Logo (500x500).png
Executable file
After Width: | Height: | Size: 55 KiB |
BIN
contrib/iSenWeb/themes/images/common/Logo.png
Executable file
After Width: | Height: | Size: 53 KiB |
BIN
contrib/iSenWeb/themes/images/common/Logo_lab.png
Executable file
After Width: | Height: | Size: 24 KiB |
BIN
contrib/iSenWeb/themes/images/common/header_bg.png
Executable file
After Width: | Height: | Size: 3.6 KiB |
BIN
contrib/iSenWeb/themes/images/common/ico_cor10.png
Executable file
After Width: | Height: | Size: 958 B |
BIN
contrib/iSenWeb/themes/images/common/icon_feedback.png
Executable file
After Width: | Height: | Size: 6.1 KiB |
BIN
contrib/iSenWeb/themes/images/common/logo_christmas.png
Executable file
After Width: | Height: | Size: 28 KiB |
BIN
contrib/iSenWeb/themes/images/common/logo_christmas1.png
Executable file
After Width: | Height: | Size: 6.2 KiB |
BIN
contrib/iSenWeb/themes/images/common/logo_christmas2.png
Executable file
After Width: | Height: | Size: 10 KiB |
BIN
contrib/iSenWeb/themes/images/common/logo_christmas3.png
Executable file
After Width: | Height: | Size: 34 KiB |
BIN
contrib/iSenWeb/themes/images/common/nav_bgn.png
Executable file
After Width: | Height: | Size: 2.9 KiB |
BIN
contrib/iSenWeb/themes/images/common/sidebar_bg.png
Executable file
After Width: | Height: | Size: 10 KiB |
BIN
contrib/iSenWeb/themes/images/fanyi/fanyi_sprite.png
Executable file
After Width: | Height: | Size: 8.5 KiB |
BIN
contrib/iSenWeb/themes/images/fanyi/inputTextBg.png
Executable file
After Width: | Height: | Size: 501 B |
BIN
contrib/iSenWeb/themes/images/search/s.png
Executable file
After Width: | Height: | Size: 4.3 KiB |
288
contrib/iSenWeb/themes/styles/common.css
Executable file
@ -0,0 +1,288 @@
|
||||
@charset "utf-8";
|
||||
|
||||
html,body,div,span,applet,object,iframe,table,caption,tbody,tfoot,thead,tr,th,td,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,tt,var,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,dl,dt,dd,ol,ul,li,fieldset,form,label,legend {
|
||||
outline:0;
|
||||
padding:0;
|
||||
margin:0;
|
||||
border:0;
|
||||
text-align:left;
|
||||
font-style:normal;
|
||||
word-wrap:break-word;
|
||||
}
|
||||
:focus {
|
||||
outline:0;
|
||||
}
|
||||
body {
|
||||
font-family:"Microsoft Yahei","\534E\6587\9ED1\4F53","Arail","Verdana","Helvetica","sans-serif";
|
||||
color:#999;
|
||||
font-size:12px;
|
||||
}
|
||||
ol,ul,li {
|
||||
list-style:none;
|
||||
}
|
||||
table {
|
||||
border-collapse:collapse;
|
||||
border-spacing:0;
|
||||
width:100%;
|
||||
}
|
||||
caption,th,td {
|
||||
font-weight:normal;
|
||||
text-align:left;
|
||||
vertical-align:top;
|
||||
}
|
||||
a:link,a:visited {
|
||||
font-family:"Microsoft Yahei";
|
||||
color:#568d99;
|
||||
text-decoration:none;
|
||||
}
|
||||
a:hover {
|
||||
font-family:"Microsoft Yahei";
|
||||
color:#568d99;
|
||||
text-decoration:underline;
|
||||
}
|
||||
input.txt {
|
||||
border-top:1px solid #cdcdcd;
|
||||
border-left:1px solid #a4a4a4;
|
||||
border-bottom:1px solid #e8e8e8;
|
||||
border-right:1px solid #d9d9d9;
|
||||
font-family:Arial,Helvetica,sans-serif;
|
||||
color:#666;
|
||||
font-size:14px
|
||||
}
|
||||
body {
|
||||
background:#eeefef;
|
||||
}
|
||||
.topWrap {
|
||||
height:200px;
|
||||
background:url(../images/common/header_bg.png) repeat-x center top;
|
||||
}
|
||||
.topW {
|
||||
width:940px;
|
||||
position:relative;
|
||||
margin:0 auto;
|
||||
}
|
||||
.top {
|
||||
width:900px;
|
||||
margin:0 auto;
|
||||
height:90px;
|
||||
z-index:100;
|
||||
}
|
||||
.top .logo {
|
||||
width:20px;
|
||||
height:300px;
|
||||
background:url(../images/common/Logo.png) no-repeat;
|
||||
_background:url(../images/common/logo.gif) no-repeat;
|
||||
float:left;
|
||||
margin:0px 0 0 0;
|
||||
}
|
||||
.top .logNoLogin {
|
||||
width:159px;
|
||||
overflow:hidden
|
||||
}
|
||||
.top .logo a {
|
||||
width:165px;
|
||||
height:55px;
|
||||
float:left;
|
||||
text-indent:-9999px;
|
||||
}
|
||||
.top .nav {
|
||||
float:right;
|
||||
margin-top:37px;
|
||||
font-size:16px;
|
||||
position:relative;
|
||||
width:542px;
|
||||
}
|
||||
.top .nav a {
|
||||
height:35px;
|
||||
line-height:23px;
|
||||
margin-left:10px;
|
||||
padding:0 10px;
|
||||
float:left;
|
||||
display:block;
|
||||
overflow:hidden;
|
||||
text-decoration:none;
|
||||
text-align:center;
|
||||
color:#3c6770;
|
||||
}
|
||||
.top .nav a:hover {
|
||||
background:url(../images/common/nav_bgn.png) no-repeat 0 -40px;
|
||||
_background:url(../images/common/nav_bgn.gif) no-repeat 0 -40px;
|
||||
color:#3c6770;
|
||||
}
|
||||
.top .nav a.current {
|
||||
background:url(../images/common/nav_bgn.png) no-repeat center 0;
|
||||
_background:url(../images/common/nav_bgn.gif) no-repeat center 0;
|
||||
}
|
||||
.top .nav .uname {
|
||||
float:right
|
||||
}
|
||||
.top .nav a.username {
|
||||
height:26px;
|
||||
max-width:96px;
|
||||
padding-right:4px;
|
||||
cursor:pointer;
|
||||
display:inline-block;
|
||||
vertical-align:middle
|
||||
}
|
||||
.top .nav a.username:hover {
|
||||
background:none;
|
||||
}
|
||||
.top .nav .uname .cor {
|
||||
display:inline-block;
|
||||
width:12px;
|
||||
height:12px;
|
||||
background:url(../images/common/ico_cor10.png) 0 0 no-repeat;
|
||||
cursor:pointer;
|
||||
vertical-align:middle;
|
||||
overflow:hidden
|
||||
}
|
||||
.noLogin .nav {
|
||||
width:auto;
|
||||
margin-right:48px;
|
||||
}
|
||||
|
||||
|
||||
.ConBox {
|
||||
width:900px;
|
||||
min-height:600px;
|
||||
margin:15px auto 50px auto;
|
||||
padding-bottom:8px;
|
||||
-webkit-box-shadow:0 0 5px 0 #aeaeae;
|
||||
-moz-box-shadow:0 0 5px 0 #aeaeae;
|
||||
-box-shadow:0 0 5px 0 #aeaeae;
|
||||
-webkit-border-radius:8px;
|
||||
-moz-border-radius:8px;
|
||||
border-radius:8px;
|
||||
background:#fff
|
||||
}
|
||||
.ConBox .hd {
|
||||
padding:30px 30px 10px;
|
||||
}
|
||||
.ConBox .hd_left {
|
||||
float:left;
|
||||
width:560px;
|
||||
|
||||
}
|
||||
.ConBox .hd_right {
|
||||
float:right;
|
||||
width:260px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.ConBox .bd {
|
||||
padding:0px;
|
||||
float:right;
|
||||
}
|
||||
|
||||
.ConBox .rank-index {
|
||||
background-color: #E0EEF7;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.ConBox .right-panel-title {
|
||||
color: #035168;
|
||||
font: bolder 16px/ 18px "Microsoft Yahei";
|
||||
margin: 0 0 5px 0;
|
||||
}
|
||||
|
||||
.searchbar {
|
||||
width:900px;
|
||||
margin:10px auto 0;
|
||||
overflow:hidden;
|
||||
*zoom:1;
|
||||
}
|
||||
.searchbar .bd {
|
||||
float:right;
|
||||
border:1px solid #CBCBCD;
|
||||
height:28px;
|
||||
position:relative;
|
||||
width:181px;
|
||||
}
|
||||
.searchbar .bd input.ipt {
|
||||
background:url(../images/common/sidebar_bg.png) no-repeat 0 -300px;
|
||||
border:0 none;
|
||||
color:#cfcfcf;
|
||||
font-family:"Microsoft Yahei",arial;
|
||||
font-size:14px;
|
||||
height:28px;
|
||||
*height:27px;
|
||||
line-height:28px;
|
||||
margin:0;
|
||||
padding:0 33px 0 9px;
|
||||
width:119px;
|
||||
_background:url(../images/common/sidebar_bg.gif) 0 -300px no-repeat;
|
||||
*background-position:0 -301px;
|
||||
}
|
||||
.searchbar .bd input.btn {
|
||||
background:url(../images/common/sidebar_bg.png) no-repeat -188px -343px;
|
||||
border:0 none;
|
||||
cursor:pointer;
|
||||
height:28px;
|
||||
position:absolute;
|
||||
right:0;
|
||||
top:0;
|
||||
width:30px;
|
||||
_background:url(../images/common/sidebar_bg.gif) -188px -343px no-repeat;
|
||||
}
|
||||
.searchbar .inpt_focus {
|
||||
border:1px solid #649C9C;
|
||||
}
|
||||
.searchbar .inpt_focus input.btn {
|
||||
background-position:-188px -473px;
|
||||
}
|
||||
.searchbar .inpt_focus input.ipt {
|
||||
color:#333;
|
||||
}
|
||||
.wrap {
|
||||
clear:both;
|
||||
}
|
||||
.container {
|
||||
width:960px;
|
||||
margin:60px auto 0;
|
||||
}
|
||||
.content .bd {
|
||||
clear:both;
|
||||
}
|
||||
.footer {
|
||||
width:960px;
|
||||
height:66px;
|
||||
padding-top:20px;
|
||||
color:#b9b8b8;
|
||||
text-align:center;
|
||||
}
|
||||
.footer p {
|
||||
text-align:center;
|
||||
line-height:23px;
|
||||
}
|
||||
.footer a,.footer a:link {
|
||||
color:#b9b8b8;
|
||||
text-decoration:none;
|
||||
}
|
||||
.footer a:hover {
|
||||
color:#b9b8b8;
|
||||
text-decoration:underline;
|
||||
}
|
||||
.top .logo {
|
||||
height:200px;
|
||||
width:550px;
|
||||
background:url(../images/common/Logo_lab.png) no-repeat;
|
||||
_background:url(../images/common/logo_christmas_ie6.png) no-repeat
|
||||
}
|
||||
|
||||
|
||||
.Feedback {
|
||||
right: 0;
|
||||
position: fixed;
|
||||
top: 40%;
|
||||
_position: absolute;
|
||||
z-index: 85;
|
||||
}
|
||||
.Feedback a {
|
||||
display: block;
|
||||
width: 41px;
|
||||
height: 127px;
|
||||
background: url(../images/common/icon_feedback.png) no-repeat;
|
||||
text-indent: -9999px;
|
||||
overflow: hidden;
|
||||
}
|
583
contrib/iSenWeb/themes/styles/fanyi.css
Executable file
@ -0,0 +1,583 @@
|
||||
|
||||
.column {
|
||||
width:50%;
|
||||
}
|
||||
.fl .wrapper {
|
||||
padding-right:20px;
|
||||
_padding-right:10px;
|
||||
}
|
||||
h2 {
|
||||
height:20px;
|
||||
font-size:1.2em;
|
||||
}
|
||||
.column .row {
|
||||
padding-top:.5em;
|
||||
}
|
||||
#transForm .user-research {
|
||||
float:right;
|
||||
}
|
||||
#transForm .user-research a {
|
||||
font-family:"宋体";
|
||||
}
|
||||
#transForm .desc {
|
||||
zoom:1;
|
||||
}
|
||||
.column .desc {
|
||||
position:relative;
|
||||
color:#333333;
|
||||
font-size:14px;
|
||||
}
|
||||
.text {
|
||||
width:100%;
|
||||
padding:0;
|
||||
background:#fff;
|
||||
}
|
||||
input.text {
|
||||
padding:3px 0;
|
||||
}
|
||||
.button {
|
||||
width:5em;
|
||||
*height:23px;
|
||||
*padding-top:2px;
|
||||
}
|
||||
.actions a {
|
||||
display:none;
|
||||
}
|
||||
#inputText {
|
||||
display:block;
|
||||
border-width:0 1px 1px 0;
|
||||
border-color:#E5E5E5;
|
||||
border-style:solid;
|
||||
background:url("../images/fanyi/inputTextBg.png") no-repeat 0 0;
|
||||
_background-attachment:fixed;
|
||||
font-size:14px;
|
||||
line-height:140%;
|
||||
padding:10px 0 10px 10px;
|
||||
height:187px;
|
||||
resize:none;
|
||||
outline:none;
|
||||
font-family:arial,sans-serif;
|
||||
}
|
||||
*+html #inputText {
|
||||
background:none;
|
||||
border-width:2px 1px 1px 2px;
|
||||
height:185px;
|
||||
}
|
||||
@-moz-document url-prefix() {
|
||||
#inputText {
|
||||
padding:3px 0 1px 10px;
|
||||
height:204px;
|
||||
}
|
||||
}#customSelectBtn {
|
||||
position:relative;
|
||||
*float:left;
|
||||
display:inline-block;
|
||||
width:85px;
|
||||
height:22px;
|
||||
padding:1px 20px 1px 5px;
|
||||
margin-right:5px;
|
||||
line-height:22px;
|
||||
border:1px solid #9fc7e3;
|
||||
vertical-align:bottom;
|
||||
cursor:pointer;
|
||||
color:#000000;
|
||||
}
|
||||
#customSelectBtn .btn_arrow {
|
||||
position:absolute;
|
||||
top:10px;
|
||||
right:5px;
|
||||
border-width:5px;
|
||||
border-style:solid dashed dashed dashed;
|
||||
border-color:#9fc7e3 transparent transparent transparent;
|
||||
line-height:0;
|
||||
font-size:0;
|
||||
width:0;
|
||||
height:0;
|
||||
}
|
||||
#customSelectBtn.focus .btn_arrow {
|
||||
top:4px;
|
||||
border-style:dashed dashed solid dashed;
|
||||
border-color:transparent transparent #9fc7e3 transparent;
|
||||
}
|
||||
#customSelectOption {
|
||||
width:110px;
|
||||
padding:0;
|
||||
margin:1px 0 0;
|
||||
list-style:none;
|
||||
font-size:12px;
|
||||
border:1px solid #9fc7e3;
|
||||
background:#fff;
|
||||
position:absolute;
|
||||
z-index:9999;
|
||||
left:-1px;
|
||||
top:23px;
|
||||
display:none;
|
||||
}
|
||||
#customSelectOption a {
|
||||
display:block;
|
||||
height:22px;
|
||||
padding:0 5px;
|
||||
line-height:22px;
|
||||
text-decoration:none;
|
||||
color:#2a2a2a;
|
||||
}
|
||||
#customSelectOption a:hover,#customSelectOption .on a {
|
||||
background:#9fc7e3;
|
||||
}
|
||||
#translateBtn {
|
||||
width:74px;
|
||||
height:26px;
|
||||
text-indent:-999em;
|
||||
overflow:hidden;
|
||||
background:#fff url(../images/fanyi/fanyi_sprite.png) left -42px;
|
||||
cursor:pointer;
|
||||
outline:none;
|
||||
display:inline-block;
|
||||
vertical-align:top;
|
||||
}
|
||||
#translateBtn:hover {
|
||||
background-position:-74px -42px;
|
||||
}
|
||||
#translateBtn:active {
|
||||
background-position:-148px -42px;
|
||||
}
|
||||
#outputMod {
|
||||
position:relative;
|
||||
}
|
||||
#speech {
|
||||
display:inline-block;
|
||||
width:16px;
|
||||
height:0;
|
||||
padding-top:13px;
|
||||
margin:0 5px -2px;
|
||||
overflow:hidden;
|
||||
background:url(../images/fanyi/fanyi_sprite.png) no-repeat -168px top;
|
||||
}
|
||||
#speech:hover,#speech.on {
|
||||
background-position:-168px -13px;
|
||||
}
|
||||
#outputMod .desc {
|
||||
position:relative;
|
||||
zoom:1;
|
||||
height:14px;
|
||||
}
|
||||
#entryList {
|
||||
padding:40px 0 0;
|
||||
margin:0 0 0 18px;
|
||||
list-style:none;
|
||||
}
|
||||
#entryList li {
|
||||
position:relative;
|
||||
height:42px;
|
||||
line-height:42px;
|
||||
padding-left:40px;
|
||||
margin-bottom:5px;
|
||||
white-space:nowrap;
|
||||
color:#666;
|
||||
}
|
||||
#entryList .sp {
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
width:36px;
|
||||
padding-top:42px;
|
||||
background:url(../images/fanyi/fanyi_sprite.png) no-repeat right top;
|
||||
}
|
||||
#translated {
|
||||
display:none;
|
||||
zoom:1;
|
||||
}
|
||||
#copyit {
|
||||
vertical-align:middle;
|
||||
margin-top:-2px;
|
||||
}
|
||||
#outputText {
|
||||
padding:15px 20px 0;
|
||||
line-height:140%;
|
||||
word-wrap:break-word;
|
||||
overflow-y:auto;
|
||||
background-color:#fafafa;
|
||||
height:193px;
|
||||
font-family:arial,sans-serif;
|
||||
}
|
||||
#translated .small_font .translated_result .tgt {
|
||||
font-size:14px;
|
||||
font-weight:normal;
|
||||
margin-bottom:.4em;
|
||||
}
|
||||
#translated .small_font {
|
||||
padding:10px 12px;
|
||||
height:188px;
|
||||
}
|
||||
#outputText .src {
|
||||
color:#787878;
|
||||
font-size:1em;
|
||||
margin-bottom:2px;
|
||||
}
|
||||
#outputText .tgt {
|
||||
margin-bottom:10px;
|
||||
font-size:1.5em;
|
||||
font-weight:bold;
|
||||
line-height:150%;
|
||||
}
|
||||
#outputText .selected {
|
||||
background-color:#316ac5;
|
||||
color:#fff;
|
||||
}
|
||||
.smart_result {
|
||||
padding:.5em .8em 0 0;
|
||||
border-top:1px solid #e0e0e0;
|
||||
color:#000;
|
||||
}
|
||||
.smart_src_title {
|
||||
color:#777;
|
||||
font-size:1.2em;
|
||||
margin-bottom:.6em;
|
||||
}
|
||||
.smart_result p {
|
||||
margin:5px 0 5px 0;
|
||||
line-height:125%;
|
||||
}
|
||||
.smart_result p a {
|
||||
float:right;
|
||||
margin-left:6px;
|
||||
}
|
||||
.smart_result p span {
|
||||
overflow:hidden;
|
||||
zoom:1;
|
||||
display:block;
|
||||
}
|
||||
.smartresult_more {
|
||||
font-size:12px;
|
||||
margin-top:5px;
|
||||
font-family:"宋体";
|
||||
}
|
||||
.compare-mode {
|
||||
font-weight:bold;
|
||||
}
|
||||
#modeWrapper {
|
||||
margin-top:-3px;
|
||||
padding:3px 0;
|
||||
*padding:0;
|
||||
}
|
||||
.read-mode {
|
||||
float:right;
|
||||
display:none;
|
||||
}
|
||||
.read-mode .title {
|
||||
background:url("../images/fanyi/fanyi_sprite.png") no-repeat -168px -28px;
|
||||
padding-left:18px;
|
||||
outline:none;
|
||||
}
|
||||
.compare-mode input {
|
||||
vertical-align:top;
|
||||
*vertical-align:middle;
|
||||
margin:0 3px 0 0;
|
||||
border:0;
|
||||
padding:0;
|
||||
}
|
||||
#errorHolder {
|
||||
display:none;
|
||||
position:absolute;
|
||||
z-index:9999;
|
||||
top:-25px;
|
||||
left:50%;
|
||||
text-align:center;
|
||||
font-size:12px;
|
||||
}
|
||||
#errorHolder.nullError {
|
||||
left:20%;
|
||||
top:120px;
|
||||
}
|
||||
#errorHolder .error_text {
|
||||
background:#3b7fc2;
|
||||
display:inline-block;
|
||||
padding:5px 10px;
|
||||
height:15px;
|
||||
line-height:15px;
|
||||
color:#fff;
|
||||
}
|
||||
#errorHolder .error_text a {
|
||||
text-decoration:underline;
|
||||
}
|
||||
#errorHolder.nullError .error_text {
|
||||
width:72px;
|
||||
text-align:center;
|
||||
}
|
||||
#errorHolder .add-fav {
|
||||
color:white;
|
||||
}
|
||||
#errorHolder #closeit {
|
||||
margin-left:8px;
|
||||
}
|
||||
.tip-close {
|
||||
cursor:pointer;
|
||||
}
|
||||
#addons {
|
||||
display:none;
|
||||
}
|
||||
#transBtnTip {
|
||||
display:none;
|
||||
position:absolute;
|
||||
z-index:999;
|
||||
left:100px;
|
||||
top:100px;
|
||||
font-size:12px;
|
||||
*background:#4570e0;
|
||||
}
|
||||
#transBtnTipInner {
|
||||
position:relative;
|
||||
padding:10px 15px;
|
||||
*margin:-1px 1px;
|
||||
color:#fff;
|
||||
background:#4570e0;
|
||||
-moz-border-radius:7px;
|
||||
-khtml-border-radius:7px;
|
||||
-webkit-border-radius:7px;
|
||||
border-radius:7px;
|
||||
}
|
||||
#transBtnTip .ar {
|
||||
margin-top:10px;
|
||||
}
|
||||
#transBtnTipOK {
|
||||
font-weight:bold;
|
||||
color:#fff;
|
||||
}
|
||||
#transBtnTipArrow {
|
||||
position:absolute;
|
||||
left:50px;
|
||||
top:100%;
|
||||
display:block;
|
||||
border-color:transparent transparent transparent #4570e0;
|
||||
border-width:0 0 20px 20px;
|
||||
border-style:dashed dashed dashed solid;
|
||||
font-size:0;
|
||||
}
|
||||
#sponsor {
|
||||
padding:1em 0 0;
|
||||
clear:both;
|
||||
}
|
||||
#sponsor .desc {
|
||||
white-space:normal;
|
||||
zoom:1;
|
||||
}
|
||||
#sponsor .fr {
|
||||
overflow:hidden;
|
||||
}
|
||||
#sponsor .more-services {
|
||||
background-color:#eff7fd;
|
||||
padding-left:10px;
|
||||
height:26px;
|
||||
line-height:26px;
|
||||
text-align:left;
|
||||
}
|
||||
#sponsor .more-services-list {
|
||||
margin-bottom:1em;
|
||||
border:1px #eff7fd solid;
|
||||
padding:5px 12px 4px 22px;
|
||||
}
|
||||
#sponsor .more-services-icon-sprite {
|
||||
background:url("../images/fanyi/fanyi_sprite.png") no-repeat 0 0;
|
||||
float:left;
|
||||
padding-left:40px;
|
||||
padding-top:40px;
|
||||
line-height:0;
|
||||
font-size:0;
|
||||
}
|
||||
#sponsor .icon1 {
|
||||
background-position:0 0;
|
||||
}
|
||||
#sponsor .icon2 {
|
||||
background-position:-40px 0;
|
||||
}
|
||||
#sponsor .icon3 {
|
||||
background-position:-80px 0;
|
||||
}
|
||||
#sponsor .icon4 {
|
||||
background-position:-120px 0;
|
||||
}
|
||||
#trans_tools {
|
||||
width:100%;
|
||||
}
|
||||
#trans_tools td {
|
||||
margin:0;
|
||||
padding:0;
|
||||
width:25%;
|
||||
}
|
||||
#trans_tools h3 {
|
||||
float:left;
|
||||
margin-left:10px;
|
||||
padding:0 10px 0 0;
|
||||
line-height:40px;
|
||||
font-size:1.2em;
|
||||
}
|
||||
#trans_tools p {
|
||||
padding:5px 10px 0 0;
|
||||
color:#777;
|
||||
font-size:1.2em;
|
||||
}
|
||||
#suggestYou {
|
||||
color:#777;
|
||||
font-family:"宋体";
|
||||
}
|
||||
#feedback_link {
|
||||
font-family:"宋体";
|
||||
}
|
||||
.new {
|
||||
color:#e60012;
|
||||
font-size:12px;
|
||||
}
|
||||
.close-reading-mode {
|
||||
display:none;
|
||||
}
|
||||
.open-reading-mode {
|
||||
display:none;
|
||||
}
|
||||
.for-close {
|
||||
display:none;
|
||||
}
|
||||
.show-reading-mode .open-reading-mode {
|
||||
display:inline-block;
|
||||
}
|
||||
.reading-mode #inputMod {
|
||||
display:none;
|
||||
}
|
||||
.reading-mode #outputMod {
|
||||
margin:0 auto;
|
||||
float:none;
|
||||
}
|
||||
.reading-mode .column {
|
||||
width:65%;
|
||||
}
|
||||
.reading-mode #outputMod #addons {
|
||||
display:none;
|
||||
}
|
||||
.reading-mode #outputMod #outputText {
|
||||
background-color:transparent;
|
||||
border-top:1px solid #e5e5e5;
|
||||
border-bottom:1px solid #e5e5e5;
|
||||
}
|
||||
.reading-mode #sponsor {
|
||||
display:none;
|
||||
}
|
||||
.reading-mode #translated .small_font {
|
||||
height:auto;
|
||||
padding:10px 0;
|
||||
}
|
||||
.reading-mode .for-close {
|
||||
display:block;
|
||||
}
|
||||
.reading-mode .close-reading-mode {
|
||||
display:inline-block;
|
||||
}
|
||||
.reading-mode .open-reading-mode {
|
||||
display:none;
|
||||
}
|
||||
.reading-mode #translated .small_font .translated_result .tgt {
|
||||
margin-bottom:.6em;
|
||||
padding-bottom:.6em;
|
||||
}
|
||||
#selectorSwitcher {
|
||||
float:right;
|
||||
margin-top:-3px;
|
||||
height:20px;
|
||||
line-height:20px;
|
||||
cursor:pointer;
|
||||
}
|
||||
#selectorStatus {
|
||||
margin-left:21px;
|
||||
margin-right:6px;
|
||||
color:#1e50a2;
|
||||
}
|
||||
.selector-sprite {
|
||||
background:url("../p/switcher.png") no-repeat 0 0;
|
||||
}
|
||||
.selector-enable {
|
||||
background-position:-51px -22px;
|
||||
}
|
||||
.selector-enable.hover {
|
||||
background-position:0 -22px;
|
||||
}
|
||||
.selector-disable {
|
||||
background-position:-51px 0;
|
||||
}
|
||||
.selector-disable.hover {
|
||||
background-position:0 0;
|
||||
}
|
||||
.show-translate #addons {
|
||||
display:block;
|
||||
}
|
||||
#b {
|
||||
border-top:0 solid;
|
||||
max-width:960px;
|
||||
min-width:500px;
|
||||
_width:960px;
|
||||
font-family:arial sans-serif;
|
||||
}
|
||||
#transForm .content {
|
||||
position:relative;
|
||||
zoom:1;
|
||||
}
|
||||
.typo-suggest {
|
||||
display:none;
|
||||
position:absolute;
|
||||
bottom:10px;
|
||||
left:12px;
|
||||
font-size:1.2em;
|
||||
font-family:verdana,sens-serif;
|
||||
color:#dc143c;
|
||||
}
|
||||
.typo-suggest a.spell-corrected {
|
||||
text-decoration:underline;
|
||||
}
|
||||
.typo-suggest b {
|
||||
font-style:italic;
|
||||
font-weight:bold;
|
||||
}
|
||||
.ads {
|
||||
background-color:#FEFEEE;
|
||||
}
|
||||
#outputMod .wrapper {
|
||||
_padding-right:15px;
|
||||
}
|
||||
#addons {
|
||||
_padding-right:15px;
|
||||
}
|
||||
#microBlog {
|
||||
float:right;
|
||||
padding-right:5px;
|
||||
}
|
||||
#microBlog dd,#microBlog dt {
|
||||
float:left;
|
||||
padding-top:4px;
|
||||
height:20px;
|
||||
line-height:20px;
|
||||
}
|
||||
#microBlog dd {
|
||||
padding-top:4px;
|
||||
height:20px;
|
||||
}
|
||||
#microBlog .blog {
|
||||
display:inline-block;
|
||||
background:url('../images/fanyi/anyi_sprite.png') no-repeat;
|
||||
width:20px;
|
||||
height:20px;
|
||||
}
|
||||
#microBlog a.netease {
|
||||
background-position:-110px -69px;
|
||||
}
|
||||
#microBlog a.sina {
|
||||
background-position:-132px -69px;
|
||||
}
|
||||
#microBlog a.tencent {
|
||||
background-position:-155px -69px;
|
||||
}
|
||||
#microBlog a.kaixin001 {
|
||||
background-position:-177px -69px;
|
||||
}
|
||||
.fl {
|
||||
float:left;
|
||||
}
|
||||
.fr {
|
||||
float:right;
|
||||
}
|
31
contrib/iSenWeb/themes/styles/search.css
Executable file
@ -0,0 +1,31 @@
|
||||
/* TOP SEARCH */
|
||||
#ts{position:relative;float: right; font-size:10px;}
|
||||
/* query form */
|
||||
.fc,.aca,.qb,.rqb{background:url(/MosesServer-cgi/themes/images/search/s.png) no-repeat}
|
||||
.fc{position:relative;width:415px;height:33px;padding:2px 0 2px 2px;background-position:-3px -3px}
|
||||
.fc input{font-family:Arial,sans-serif;border:none}
|
||||
.qc{position:relative;float:left;width:325px;padding:3px 2px;border-right:1px solid #6a8aae}
|
||||
.q{width:294px;height:23px;padding:3px 0 0 2px;*margin:-1px 0;font-size:1.6em;background:transparent;*border:1px solid #fff;outline:none}
|
||||
.aca{position:absolute;right:2px;top:3px;width:26px;height:0;padding-top:26px;overflow:hidden;text-indent:-9999em;background-position:-415px -3px;cursor:pointer}
|
||||
.qb{width:81px;height:33px;padding:0 0 2px 1px;*padding:2px 0 0 1px;margin:0;_margin-left:-3px;font-weight:bold;font-size:1.4em;word-spacing:4px;color:#fff;background-position:right -50px;background-color:transparent;cursor:pointer}
|
||||
.no-suggest .q{width:320px}
|
||||
/* BOTTOM SEARCH */
|
||||
#bs{margin:15px 0 20px;font-size:10px;}
|
||||
#bs .q{width:320px}
|
||||
input.rqb{position:absolute;right:-110px;top:2px;width:102px;height:32px;padding-top:32px;overflow:hidden;text-indent:-9999em;background-color:transparent;background-position:left -50px;cursor:pointer}
|
||||
|
||||
|
||||
/* suggest */
|
||||
.sw{font-size:1.4em;border:1px solid #8cbbdd}
|
||||
.sw table{background:#fff;border-collapse:collapse}
|
||||
.remindtt75,.jstxlan{padding-left: .2em;font-size: 14px;height: 23px;line-height: 23px;}
|
||||
.remindtt752{padding:.2em;color:#808080;font-size:14px}
|
||||
.jstxlan{color:#808080;font-size:13px;cursor:pointer; float:right}
|
||||
.jstxhuitiaoyou{margin:-1px 0;border-top:1px solid #dbeffe;background:#eaf1fd}
|
||||
.aa_highlight{color:#fff;background:#3971bf}
|
||||
/* MODULES */
|
||||
.pm{display:none;width:70px;border:1px solid;font-size:13px;border-color:#8cbbdd;background:#fff}
|
||||
.pm ul{padding:0;margin:0;list-style:none}
|
||||
.pm a{display:block;padding:4px 3px;text-decoration:none;zoom:1}
|
||||
.pm a:hover{color:#fff;background:#3971bf}
|
||||
.pm .sl{height:0;margin:0 1px;*margin-top:-10px;font-size:0;border-bottom:1px solid #8cbbdd}
|
10
contrib/iSenWeb/trans_result.php
Executable file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
$result = "";
|
||||
$Content = $_POST['input1'];
|
||||
$ereg='/\n/';
|
||||
$arr_str = preg_split($ereg,$Content);
|
||||
foreach($arr_str as $value){
|
||||
$result = ` echo $value | nc 161.64.89.129 1986`;
|
||||
echo $result.'<br>';
|
||||
}
|
||||
?>
|
@ -4,6 +4,18 @@
|
||||
# mert-moses.pl <foreign> <english> <decoder-executable> <decoder-config>
|
||||
# For other options see below or run 'mert-moses.pl --help'
|
||||
|
||||
#
|
||||
# NB: This is a variant of of mert-moses.pl for use with the interpolated scorer
|
||||
# (MergeScorer) described in the following paper:
|
||||
#
|
||||
# "Optimising Multiple Metrics with MERT" by Christophe Servan and Holger Schwenk,
|
||||
# Prague Bulletin of Mathematical Linguistics 96 (2011) p109-117
|
||||
# http://www-lium.univ-lemans.fr/~servan/publications/Servan_PBML_2011.pdf
|
||||
#
|
||||
# If you are not using MergeScorer, then you should use the mert-moses.pl script instead
|
||||
#
|
||||
|
||||
|
||||
# Notes:
|
||||
# <foreign> and <english> should be raw text files, one sentence per line
|
||||
# <english> can be a prefix, in which case the files are <english>0, <english>1, etc. are used
|
||||
@ -47,10 +59,10 @@
|
||||
# 13 Oct 2004 Use alternative decoders (DWC)
|
||||
# Original version by Philipp Koehn
|
||||
|
||||
use FindBin qw($Bin);
|
||||
use FindBin qw($RealBin);
|
||||
use File::Basename;
|
||||
use File::Path;
|
||||
my $SCRIPTS_ROOTDIR = $Bin;
|
||||
my $SCRIPTS_ROOTDIR = $RealBin;
|
||||
$SCRIPTS_ROOTDIR =~ s/\/training$//;
|
||||
$SCRIPTS_ROOTDIR = $ENV{"SCRIPTS_ROOTDIR"} if defined($ENV{"SCRIPTS_ROOTDIR"});
|
||||
|
@ -1,54 +0,0 @@
|
||||
[11/09/2010]
|
||||
MOSES FOR MERE MORTALS
|
||||
======================
|
||||
Moses for Mere Mortals (MMM) has been tested with Ubuntu 10.04 LTS and the Moses version published on August 13, 2010 and updated on August 14, 2010 (http://sourceforge.net/projects/mosesdecoder/files/mosesdecoder/2010-08-13/moses-2010-08-13.tgz/download).
|
||||
|
||||
***PURPOSES***:
|
||||
===============
|
||||
|
||||
1) MOSES INSTALLATION WITH A SINGLE COMMAND
|
||||
-------------------------------------------
|
||||
If you aren't used to compiling Linux programs (both Moses and the packages upon which it depends), you'll love this!
|
||||
|
||||
2) MOSES VERY SIMPLE DEMO
|
||||
-------------------------
|
||||
MMM is meant to quickly allow you to get results with Moses. You can place MMM wherever you prefer on your hard disk and then call, with a single command, each of its several scripts (their version number is omitted here):
|
||||
a) create (in order to compile Moses and the packages it uses with a single command);
|
||||
b) make-test-files;
|
||||
c) train;
|
||||
d) translate;
|
||||
e) score the translation(s) you got; and
|
||||
f) transfer trained corpora between users or to other places of your disk.
|
||||
|
||||
MMM uses non-factored training, a type of training that in our experience already produces good results in a significant number of language pairs, and mainly with non-morphologically rich languages or with language pairs in which the target language is not morphologically rich. A Quick-Start-Guide should help you to quickly get the feel of it and start getting results.
|
||||
|
||||
It comes with a small demo corpus, too small to do justice to the quality that Moses can achieve, but sufficient for you to get a general overview of SMT and an idea of how useful Moses can be to your work, if you are strting to use it.
|
||||
|
||||
3) PROTOTYPE OF A REAL WORLD TRANSLATION CHAIN
|
||||
----------------------------------------------
|
||||
MMM enables you to use very large corpora and is being used for that purpose (translation for real translators) in our working environment. It was made having in mind that, in order to get the best results, corpora should be based on personal (ou group's) files and that many translators use translation memories. Therefore, we have coupled it with two Windows add-ins that enable you to convert your TMX files into Moses corpora and also allow you to convert the Moses translations into TMX files that translators can use with a translation memory tool.
|
||||
|
||||
4) WAY OF STARTING LEARNING MOSES AND MACHINE TRANSLATION
|
||||
---------------------------------------------------------
|
||||
MMM also comes with a very detailed Help-Tutorial (in its docs subdirectory). It therefore should ease the learning path for true beginners. The scripts code isn't particularly elegant, but most of it should be easily understandable even by beginners (if they read the Moses documentation, that is!). What's more, it does work!
|
||||
|
||||
MMM was designed to be very easy and immediately feasible to use and that's indeed why it was made for mere mortals and called as such.
|
||||
|
||||
***SOME CHARACTERISTICS***:
|
||||
===========================
|
||||
1) Compiles all the packages used by these scripts with a single instruction;
|
||||
2) Removes control characters from the input files (these can crash a training);
|
||||
3) Extracts from the corpus files 2 test files by pseudorandomly selecting non-consecutive segments that are erased from the corpus files;
|
||||
4) A new training does not interfere with the files of a previous training;
|
||||
5) A new training reuses as much as possible the files created in previous trainings (thus saving time);
|
||||
6) Detects inversions of corpora (e.g., from en-pt to pt-en), allowing a much quicker training than that of the original language pair (also checks that the inverse training is correct);
|
||||
7) Stops with an informative message if any of the phases of training (language model building, recaser training, corpus training, memory-mapping, tuning or training test) doesn't produce the expected results;
|
||||
8) Can limit the duration of tuning;
|
||||
9) Generates the BLEU and NIST scores of a translation or of a set of translations placed in a single directory (either for each whole document or for each segment of it);
|
||||
10) Allows you to transfer your trainings to someone else's computer or to another Moses installation in the same computer;
|
||||
11) All the mkcls, GIZA and MGIZA parameters can be controlled through parameters of the train script;
|
||||
12) Selected parameters of the Moses scripts and the Moses decoder can be controlled with the train and translate scripts.
|
||||
|
||||
|
||||
|
||||
|
@ -1,592 +0,0 @@
|
||||
# -*- coding: utf_8 -*-
|
||||
"""This program is used to prepare corpora extracted from TMX files.
|
||||
It is particularly useful for translators not very familiar
|
||||
with machine translation systems that want to use Moses with a highly customised
|
||||
corpus.
|
||||
|
||||
It extracts from a directory containing TMX files (and from all of its subdirectories)
|
||||
all the segments of one or more language pairs (except empty segments and segments that are equal in both languages)
|
||||
and removes all other information. It then creates 2 separate monolingual files per language pair,
|
||||
both of which have strictly parallel (aligned) segments. This kind of corpus can easily be transformed
|
||||
in other formats, if need be.
|
||||
|
||||
The program requires that Pythoncard and wxPython (as well as Python) be previously installed.
|
||||
|
||||
Copyright 2009, João Luís A. C. Rosas
|
||||
|
||||
Distributed under GNU GPL v3 licence (see http://www.gnu.org/licenses/)
|
||||
|
||||
E-mail: joao.luis.rosas@gmail.com """
|
||||
|
||||
__version__ = "$Revision: 1.042$"
|
||||
__date__ = "$Date: 2010/03/25$"
|
||||
__author__="$João Luís A. C. Rosas$"
|
||||
#Special thanks to Gary Daine for a helpful suggestion about a regex expression and for suggestions for this program to cover even more translation memories
|
||||
|
||||
from PythonCard import clipboard, dialog, graphic, model
|
||||
from PythonCard.components import button, combobox,statictext,checkbox,staticbox
|
||||
import wx
|
||||
import os, re
|
||||
import string
|
||||
import sys
|
||||
from time import strftime
|
||||
import codecs
|
||||
|
||||
|
||||
class Extract_TMX_Corpus(model.Background):
|
||||
|
||||
def on_initialize(self, event):
|
||||
"""Initialize values
|
||||
|
||||
|
||||
@self.inputdir: directory whose files will be treated
|
||||
@self.outputfile: base name of the resulting corpora files
|
||||
@self.outputpath: root directory of the resulting corpora files
|
||||
@currdir: program's current working directory
|
||||
@self.languages: list of languages whose segments can be processed
|
||||
@self.startinglanguage: something like 'EN-GB'
|
||||
@self.destinationlanguage: something like 'FR-FR'
|
||||
@self.components.cbStartingLanguage.items: list of values of the Starting Language combobox of the program's window
|
||||
@self.components.cbDestinationLanguage.items: list of values of the Destination Language combobox of the program's window
|
||||
@self.numtus: number of translation units extracted so far
|
||||
@self.presentfile: TMX file being currently processed
|
||||
@self.errortypes: variable that stocks the types of errors detected in the TMX file that is being processed
|
||||
@self.wroteactions: variable that indicates whether the actions files has already been written to
|
||||
"""
|
||||
|
||||
self.inputdir=''
|
||||
self.outputfile=''
|
||||
self.outputpath=''
|
||||
#Get directory where program file is and ...
|
||||
currdir=os.getcwd()
|
||||
#... load the file ("LanguageCodes.txt") with the list of languages that the program can process
|
||||
try:
|
||||
self.languages=open(currdir+r'\LanguageCodes.txt','r+').readlines()
|
||||
except:
|
||||
# If the languages file doesn't exist in the program directory, alert user that it is essential for the good working of the program and exit
|
||||
result = dialog.alertDialog(self, 'The file "LanguageCodes.txt" is missing. The program will now close.', 'Essential file missing')
|
||||
sys.exit()
|
||||
#remove end of line marker from each line in "LanguageCodes.txt"
|
||||
for lang in range(len(self.languages)):
|
||||
self.languages[lang]=self.languages[lang].rstrip()
|
||||
self.startinglanguage=''
|
||||
self.destinationlanguage=''
|
||||
#Insert list of language names in appropriate program window's combo boxes
|
||||
self.components.cbStartingLanguage.items=self.languages
|
||||
self.components.cbDestinationLanguage.items=self.languages
|
||||
self.tottus=0
|
||||
self.numtus=0
|
||||
self.numequaltus=0
|
||||
self.presentfile=''
|
||||
self.errortypes=''
|
||||
self.wroteactions=False
|
||||
self.errors=''
|
||||
|
||||
def extract_language_segments_tmx(self,text):
|
||||
"""Extracts TMX language segments from TMX files
|
||||
|
||||
@text: the text of the TMX file
|
||||
@pattern: compiled regular expression object, which can be used for matching
|
||||
@tus: list that collects the translation units of the text
|
||||
@segs: list that collects the segment units of the relevant pair of languages
|
||||
@numtus: number of translation units extracted
|
||||
@present_tu: variable that stocks the translation unit relevant segments (of the chosen language pair) that are being processed
|
||||
@self.errortypes: variable that stocks the types of errors detected in the TMX file that is being processed
|
||||
"""
|
||||
#print 'extract_language_segments: start at '+strftime('%H-%M-%S')
|
||||
result=('','')
|
||||
try:
|
||||
if text:
|
||||
# Convert character entities to "normal" characters
|
||||
pattern=re.compile('>',re.U)
|
||||
text=re.sub(pattern,'>',text)
|
||||
pattern=re.compile('<',re.U)
|
||||
text=re.sub(pattern,'<',text)
|
||||
pattern=re.compile('&',re.U)
|
||||
text=re.sub(pattern,'&',text)
|
||||
pattern=re.compile('"',re.U)
|
||||
text=re.sub(pattern,'"',text)
|
||||
pattern=re.compile(''',re.U)
|
||||
text=re.sub(pattern,"'",text)
|
||||
# Extract translation units
|
||||
pattern=re.compile('(?s)<tu.*?>(.*?)</tu>')
|
||||
tus=re.findall(pattern,text)
|
||||
ling1=''
|
||||
ling2=''
|
||||
#Extract relevant segments and store them in the @text variable
|
||||
if tus:
|
||||
for tu in tus:
|
||||
pattern=re.compile('(?s)<tuv.*?lang="'+self.startinglanguage+'">.*?<seg>(.*?)</seg>.*?<tuv.*?lang="'+self.destinationlanguage+'">.*?<seg>(.*?)</seg>')
|
||||
present_tu=re.findall(pattern,tu)
|
||||
self.tottus+=1
|
||||
#reject empty segments
|
||||
if present_tu: # and not present_tu[0][0].startswith("<")
|
||||
present_tu1=present_tu[0][0].strip()
|
||||
present_tu2=present_tu[0][1].strip()
|
||||
present_tu1 = re.sub('<bpt.*</bpt>', '', present_tu1)
|
||||
present_tu2 = re.sub('<bpt.*</bpt>', '', present_tu2)
|
||||
present_tu1 = re.sub(r'<ept.*</ept>', '', present_tu1)
|
||||
present_tu2 = re.sub(r'<ept.*</ept>', '', present_tu2)
|
||||
present_tu1 = re.sub(r'<ut.*</ut>', '', present_tu1)
|
||||
present_tu2 = re.sub(r'<ut.*</ut>', '', present_tu2)
|
||||
present_tu1 = re.sub(r'<ph.*</ph>', '', present_tu1)
|
||||
present_tu2 = re.sub(r'<ph.*</ph>', '', present_tu2)
|
||||
#Thanks to Gary Daine
|
||||
present_tu1 = re.sub('^[0-9\.() \t\-_]*$', '', present_tu1)
|
||||
#Thanks to Gary Daine
|
||||
present_tu2 = re.sub('^[0-9\.() \t\-_]*$', '', present_tu2)
|
||||
if present_tu1 != present_tu2:
|
||||
x=len(present_tu1)
|
||||
y=len(present_tu2)
|
||||
if (x <= y*3) and (y <= x*3):
|
||||
ling1=ling1+present_tu1+'\n'
|
||||
ling2=ling2+present_tu2+'\n'
|
||||
self.numtus+=1
|
||||
else:
|
||||
self.numequaltus+=1
|
||||
pattern=re.compile('(?s)<tuv.*?lang="'+self.destinationlanguage+'">.*?<seg>(.*?)</seg>.*?<tuv.*?lang="'+self.startinglanguage+'">.*?<seg>(.*?)</seg>')
|
||||
present_tu=re.findall(pattern,tu)
|
||||
#print present_tu
|
||||
if present_tu:
|
||||
present_tu1=present_tu[0][1].strip()
|
||||
present_tu2=present_tu[0][0].strip()
|
||||
present_tu1 = re.sub('<bpt.*</bpt>', '', present_tu1)
|
||||
present_tu2 = re.sub('<bpt.*</bpt>', '', present_tu2)
|
||||
present_tu1 = re.sub(r'<ept.*</ept>', '', present_tu1)
|
||||
present_tu2 = re.sub(r'<ept.*</ept>', '', present_tu2)
|
||||
present_tu1 = re.sub(r'<ut.*</ut>', '', present_tu1)
|
||||
present_tu2 = re.sub(r'<ut.*</ut>', '', present_tu2)
|
||||
present_tu1 = re.sub(r'<ph.*</ph>', '', present_tu1)
|
||||
present_tu2 = re.sub(r'<ph.*</ph>', '', present_tu2)
|
||||
#Thanks to Gary Daine
|
||||
present_tu1 = re.sub('^[0-9\.() \t\-_]*$', '', present_tu1)
|
||||
#Thanks to Gary Daine
|
||||
present_tu2 = re.sub('^[0-9\.() \t\-_]*$', '', present_tu2)
|
||||
if present_tu1 != present_tu2:
|
||||
x=len(present_tu1)
|
||||
y=len(present_tu2)
|
||||
if (x <= y*3) and (y <= x*3):
|
||||
ling1=ling1+present_tu1+'\n'
|
||||
ling2=ling2+present_tu2+'\n'
|
||||
self.numtus+=1
|
||||
else:
|
||||
self.numequaltus+=1
|
||||
result=(ling1,ling2)
|
||||
except:
|
||||
self.errortypes=self.errortypes+' - Extract Language Segments error\n'
|
||||
return result
|
||||
|
||||
def locate(self,pattern, basedir):
|
||||
"""Locate all files matching supplied filename pattern in and below
|
||||
supplied root directory.
|
||||
|
||||
@pattern: something like '*.tmx'
|
||||
@basedir:whole directory to be treated
|
||||
"""
|
||||
import fnmatch
|
||||
for path, dirs, files in os.walk(os.path.abspath(basedir)):
|
||||
for filename in fnmatch.filter(files, pattern):
|
||||
yield os.path.join(path, filename)
|
||||
|
||||
def getallsegments(self):
|
||||
"""Get all language segments from the TMX files in the specified
|
||||
directory
|
||||
|
||||
@self.startinglanguage: something like 'EN-GB'
|
||||
@self.destinationlanguage: something like 'FR-FR'
|
||||
@fileslist: list of files that should be processed
|
||||
@self.inputdir: directory whose files will be treated
|
||||
@startfile:output file containing all segments in the @startinglanguage; file
|
||||
will be created in @self.inputdir
|
||||
@destfile:output file containing all segments in the @destinationlanguage; file
|
||||
will be created in @self.inputdir
|
||||
@actions:output file indicating the names of all files that were processed without errors; file
|
||||
will be created in @self.inputdir
|
||||
@self.errortypes: variable that stocks the types of errors detected in the TMX file that is being processed
|
||||
@self.presentfile: TMX file being currently processed
|
||||
@preptext: parsed XML text with all tags extracted and in string format
|
||||
@tus: list that receives the extracted TMX language translation units just with segments of the relevant language pair
|
||||
@num: loop control variable between 0 and length of @tus - 1
|
||||
@self.numtus: number of translation units extracted so far
|
||||
"""
|
||||
self.statusBar.text='Processing '+ self.inputdir
|
||||
try:
|
||||
# Get a list of all TMX files that need to be processed
|
||||
fileslist=self.locate('*.tmx',self.inputdir)
|
||||
# Open output files for writing
|
||||
startfile=open(self.outputpath+'\\'+self.startinglanguage+ ' ('+self.destinationlanguage+')_' +self.outputfile,'w+b')
|
||||
destfile=open(self.outputpath+'\\'+self.destinationlanguage+' ('+self.startinglanguage+')_'+self.outputfile,'w+b')
|
||||
actions=open(self.outputpath+'\\_processing_info\\'+self.startinglanguage+ '-'+self.destinationlanguage+'_'+'actions_'+self.outputfile+'.txt','w+')
|
||||
except:
|
||||
# if any error up to now, add the name of the TMX file to the output file @errors
|
||||
self.errortypes=self.errortypes+' - Get All Segments: creation of output files error\n'
|
||||
if fileslist:
|
||||
# For each relevant TMX file ...
|
||||
for self.presentfile in fileslist:
|
||||
self.errortypes=''
|
||||
try:
|
||||
print self.presentfile
|
||||
fileObj = codecs.open(self.presentfile, "rb", "utf-16","replace",0 )
|
||||
pos=0
|
||||
while True:
|
||||
# read a new chunk of text...
|
||||
preptext = fileObj.read(692141)
|
||||
if not preptext:
|
||||
break
|
||||
last5=''
|
||||
y=''
|
||||
#... and make it end at the end of a translation unit
|
||||
while True:
|
||||
y=fileObj.read(1)
|
||||
if not y:
|
||||
break
|
||||
last5=last5+y
|
||||
if '</tu>' in last5:
|
||||
break
|
||||
preptext=preptext+last5
|
||||
# ... and extract its relevant segments ...
|
||||
if not self.errortypes:
|
||||
segs1,segs2=self.extract_language_segments_tmx(preptext)
|
||||
preptext=''
|
||||
#... and write those segments to the output files
|
||||
if segs1 and segs2:
|
||||
try:
|
||||
startfile.write('%s' % (segs1.encode('utf-8','strict')))
|
||||
destfile.write('%s' % (segs2.encode('utf-8','strict')))
|
||||
except:
|
||||
self.errortypes=self.errortypes+' - Get All Segments: writing of output files error\n'
|
||||
print 'erro'
|
||||
#if no errors up to now, insert the name of the TMX file in the @actions output file
|
||||
#encoding is necessary because @actions may be in a directory whose name has special diacritic characters
|
||||
if self.errortypes=='':
|
||||
try:
|
||||
actions.write(self.presentfile.encode('utf_8','replace')+'\n')
|
||||
self.wroteactions=True
|
||||
except:
|
||||
self.errortypes=self.errortypes+' - Get All Segments: writing of actions file error\n'
|
||||
fileObj.close()
|
||||
except:
|
||||
self.errortypes=self.errortypes+' - Error reading input file\n'
|
||||
try:
|
||||
if self.wroteactions:
|
||||
actions.write('\n*************************************************\n\n')
|
||||
actions.write('Total number of translation units: '+str(self.tottus)+'\n')
|
||||
actions.write('Number of extracted translation units (source segment not equal to destination segment): '+str(self.numtus)+'\n')
|
||||
actions.write('Number of removed translation units (source segment equal to destination segment): '+str(self.numequaltus)+'\n')
|
||||
actions.write('Number of empty translation units (source segment and/or destination segment not present): '+str(self.tottus-self.numequaltus-self.numtus))
|
||||
|
||||
except:
|
||||
self.errortypes=self.errortypes+' - Get All Segments: writing of actions file error\n'
|
||||
# Close output files
|
||||
actions.close()
|
||||
destfile.close()
|
||||
startfile.close()
|
||||
|
||||
def SelectDirectory(self):
|
||||
"""Select the directory where the TMX files to be processed are
|
||||
|
||||
@result: object returned by the dialog window with attributes accepted (true if user clicked OK button, false otherwise) and
|
||||
path (list of strings containing the full pathnames to all files selected by the user)
|
||||
@self.inputdir: directory where TMX files to be processed are (and where output files will be written)
|
||||
@self.statusBar.text: text displayed in the program window status bar"""
|
||||
|
||||
result= dialog.directoryDialog(self, 'Choose a directory', 'a')
|
||||
if result.accepted:
|
||||
self.inputdir=result.path
|
||||
self.statusBar.text=self.inputdir+' selected.'
|
||||
|
||||
def on_menuFileSelectDirectory_select(self, event):
|
||||
self.SelectDirectory()
|
||||
|
||||
def on_btnSelectDirectory_mouseClick(self, event):
|
||||
self.SelectDirectory()
|
||||
|
||||
def GetOutputFileBaseName(self):
|
||||
"""Get base name of the corpus files
|
||||
|
||||
@expr: variable containing the base name of the output files
|
||||
@wildcard: list of wildcards used in the dialog window to filter types of files
|
||||
@result: object returned by the Open File dialog window with attributes accepted (true if user clicked OK button, false otherwise) and
|
||||
path (list of strings containing the full pathnames to all files selected by the user)
|
||||
@self.inputdir: directory where TMX files to be processed are (and where output files will be written)
|
||||
@location: variable containing the full path to the base name output file
|
||||
@self.outputpath: base directory of output files
|
||||
@self.outputfile: base name of the output files
|
||||
"""
|
||||
|
||||
# Default base name of the corpora files that will be produced. If you choose as base name "Corpus.txt", as starting language "EN-GB" and as destination
|
||||
# language "FR-FR" the corpora files will be named "Corpus_EN-GB.txt" and "Corpus_FR-FR.txt"
|
||||
expr='Corpus'
|
||||
#open a dialog that lets you choose the base name of the corpora files that will be produced.
|
||||
wildcard = "Text files (*.txt;*.TXT)|*.txt;*.TXT"
|
||||
result = dialog.openFileDialog(None, "Name of corpus file", self.inputdir,expr,wildcard=wildcard)
|
||||
if result.accepted:
|
||||
location=os.path.split(result.paths[0])
|
||||
self.outputpath=location[0]
|
||||
self.outputfile = location[1]
|
||||
if not os.path.exists(self.outputpath+'\\_processing_info'):
|
||||
try:
|
||||
os.mkdir(self.outputpath+'\\_processing_info')
|
||||
except:
|
||||
result1 = dialog.alertDialog(self, "The program can't create the directory " + self.outputpath+r'\_processing_info, which is necessary for ' + \
|
||||
'the creation of the output files. The program will now close.','Error')
|
||||
sys.exit()
|
||||
|
||||
def on_menuGetOutputFileBaseName_select(self, event):
|
||||
self.GetOutputFileBaseName()
|
||||
|
||||
def on_btnGetOutputFileBaseName_mouseClick(self, event):
|
||||
self.GetOutputFileBaseName()
|
||||
|
||||
def ExtractCorpus(self):
|
||||
"""Get the directory where TMX files to be processed are, get the choice of the pair of languages that will be treated and launch the extraction
|
||||
of the corpus
|
||||
|
||||
@self.errortypes: variable that stocks the types of errors detected in the TMX file that is being processed
|
||||
@self.presentfile: TMX file being currently processed
|
||||
@self.numtus: number of translation units extracted so far
|
||||
@self.startinglanguage: something like 'EN-GB'
|
||||
@self.destinationlanguage: something like 'FR-FR'
|
||||
@self.inputdir: directory whose files will be treated
|
||||
@self.components.cbStartingLanguage.items: list of values of the Starting Language combobox of the program's window
|
||||
@self.components.cbDestinationLanguage.items: list of values of the Destination Language combobox of the program's window
|
||||
@self.outputfile: base name of the resulting corpora files
|
||||
@self.errors:output file indicating the types of error that occurred in each processed TMX file
|
||||
@self.numtus: number of translation units extracted so far
|
||||
"""
|
||||
|
||||
print 'Extract corpus: started at '+strftime('%H-%M-%S')
|
||||
self.errortypes=''
|
||||
self.presentfile=''
|
||||
self.numtus=0
|
||||
#get the startinglanguage name (e.g.: "EN-GB") from the program window
|
||||
self.startinglanguage=self.components.cbStartingLanguage.text
|
||||
#get the destinationlanguage name from the program window
|
||||
self.destinationlanguage=self.components.cbDestinationLanguage.text
|
||||
#if the directory where TMX files (@inputdir) or the pair of languages were not previously chosen, open a dialog box explaining
|
||||
#the conditions that have to be met so that the extraction can be made and do nothing...
|
||||
if (self.inputdir=='') or (self.components.cbStartingLanguage.text=='') or (self.components.cbDestinationLanguage.text=='') or (self.outputfile=='') \
|
||||
or (self.components.cbStartingLanguage.text==self.components.cbDestinationLanguage.text):
|
||||
result = dialog.alertDialog(self, 'In order to extract a corpus, you need to:\n\n 1) indicate the directory where the TMX files are,\n 2)' \
|
||||
+' the starting language,\n 3) the destination language (the 2 languages must be different), and\n 4) the base name of the output files.', 'Error')
|
||||
|
||||
#...else, go ahead
|
||||
else:
|
||||
try:
|
||||
self.errors=open(self.outputpath+'\\_processing_info\\'+self.startinglanguage+ '-'+self.destinationlanguage+'_'+'errors_'+self.outputfile+'.txt','w+')
|
||||
except:
|
||||
pass
|
||||
self.statusBar.text='Please wait. This can be a long process ...'
|
||||
#Launch the segment extraction
|
||||
self.numtus=0
|
||||
self.getallsegments()
|
||||
# if any error up to now, add the name of the TMX file to the output file @errors
|
||||
if self.errortypes:
|
||||
try:
|
||||
self.errors.write(self.presentfile.encode('utf_8','replace')+':\n'+self.errortypes)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
self.errors.close()
|
||||
except:
|
||||
pass
|
||||
self.statusBar.text='Processing finished.'
|
||||
#Open dialog box telling that processing is finished and where can the resulting files be found
|
||||
self.inputdir=''
|
||||
self.outputfile=''
|
||||
self.outputpath=''
|
||||
print 'Extract corpus: finished at '+strftime('%H-%M-%S')
|
||||
result = dialog.alertDialog(self, 'Processing done. Results found in:\n\n1) '+ \
|
||||
self.outputpath+'\\'+self.startinglanguage+ ' ('+self.destinationlanguage+')_' +self.outputfile+ ' (starting language corpus)\n2) '+ \
|
||||
self.outputpath+'\\'+self.destinationlanguage+' ('+self.startinglanguage+')_'+self.outputfile+ \
|
||||
' (destination language corpus)\n3) '+self.outputpath+'\\_processing_info\\'+self.startinglanguage+ '-'+self.destinationlanguage+'_'+ \
|
||||
'errors_'+self.outputfile+'.txt'+ ' (list of files that caused errors)\n4) '+self.outputpath+'\\_processing_info\\'+self.startinglanguage+ \
|
||||
'-'+self.destinationlanguage+'_'+'actions_'+self.outputfile+'.txt'+ ' (list of files where processing was successful)', 'Processing Done')
|
||||
|
||||
def on_menuFileExtractCorpus_select(self, event):
|
||||
self.ExtractCorpus()
|
||||
def on_btnExtractCorpus_mouseClick(self, event):
|
||||
self.ExtractCorpus()
|
||||
|
||||
def ExtractAllCorpora(self):
|
||||
"""Extracts all the LanguagePairs that can be composed with the languages indicated in the file "LanguageCodes.txt"
|
||||
|
||||
@self.presentfile: TMX file being currently processed
|
||||
@self.numtus: number of translation units extracted so far
|
||||
@numcorpora: number of language pair being processed
|
||||
@self.inputdir: directory whose files will be treated
|
||||
@self.outputfile: base name of the resulting corpora files
|
||||
@self.errors:output file indicating the types of error that occurred in each processed TMX file
|
||||
@self.startinglanguage: something like 'EN-GB'
|
||||
@self.destinationlanguage: something like 'FR-FR'
|
||||
@lang1: code of the starting language
|
||||
@lang2: code of the destination language
|
||||
@self.errortypes: variable that stocks the types of errors detected in the TMX file that is being processed
|
||||
@self.wroteactions: variable that indicates whether the actions files has already been written to
|
||||
"""
|
||||
|
||||
print 'Extract All Corpora: started at '+strftime('%H-%M-%S')
|
||||
self.presentfile=''
|
||||
self.numtus=0
|
||||
numcorpora=0
|
||||
#if the directory where TMX files (@inputdir) or the base name of the output files were not previously chosen, open a dialog box explaining
|
||||
#the conditions that have to be met so that the extraction can be made and do nothing...
|
||||
if (self.inputdir=='') or (self.outputfile==''):
|
||||
result = dialog.alertDialog(self, 'In order to extract all corpora, you need to:\n\n 1) indicate the directory where the TMX files are, and\n ' \
|
||||
+ '2) the base name of the output files.', 'Error')
|
||||
#...else, go ahead
|
||||
else:
|
||||
try:
|
||||
for lang1 in self.languages:
|
||||
for lang2 in self.languages:
|
||||
if lang2 > lang1:
|
||||
print lang1+'/'+lang2+' corpus being created...'
|
||||
numcorpora=numcorpora+1
|
||||
self.errortypes=''
|
||||
self.numtus=0
|
||||
self.wroteactions=False
|
||||
#get the startinglanguage name (e.g.: "EN-GB") from the program window
|
||||
self.startinglanguage=lang1
|
||||
#get the destinationlanguage name from the program window
|
||||
self.destinationlanguage=lang2
|
||||
try:
|
||||
self.errors=open(self.outputpath+'\\_processing_info\\'+self.startinglanguage+ '-'+self.destinationlanguage+'_'+'errors.txt','w+')
|
||||
except:
|
||||
pass
|
||||
self.statusBar.text='Language pair '+str(numcorpora)+' being processed. Please wait.'
|
||||
#Launch the segment extraction
|
||||
self.getallsegments()
|
||||
# if any error up to now, add the name of the TMX file to the output file @errors
|
||||
if self.errortypes:
|
||||
try:
|
||||
self.errors.write(self.presentfile.encode('utf_8','replace')+':\n'+self.errortypes.encode('utf_8','replace'))
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
self.errors.close()
|
||||
except:
|
||||
pass
|
||||
self.statusBar.text='Processing finished.'
|
||||
except:
|
||||
self.errortypes=self.errortypes+' - Extract All Corpora error\n'
|
||||
self.errors.write(self.presentfile.encode('utf_8','replace')+':\n'+self.errortypes.encode('utf_8','replace'))
|
||||
self.errors.close()
|
||||
#Open dialog box telling that processing is finished and where can the resulting files be found
|
||||
self.inputdir=''
|
||||
self.outputfile=''
|
||||
self.outputpath=''
|
||||
print 'Extract All Corpora: finished at '+strftime('%H-%M-%S')
|
||||
result = dialog.alertDialog(self, 'Results found in: '+ self.outputpath+'.', 'Processing done')
|
||||
|
||||
|
||||
def on_menuFileExtractAllCorpora_select(self, event):
|
||||
self.ExtractAllCorpora()
|
||||
def on_btnExtractAllCorpora_mouseClick(self, event):
|
||||
self.ExtractAllCorpora()
|
||||
|
||||
def ExtractSomeCorpora(self):
|
||||
"""Extracts the segments of the LanguagePairs indicated in the file "LanguagePairs.txt" located in the program's root directory
|
||||
|
||||
@self.presentfile: TMX file being currently processed
|
||||
@self.numtus: number of translation units extracted so far
|
||||
@currdir: current working directory of the program
|
||||
@pairsoflanguages: list of the pairs of language that are going to be processed
|
||||
@self.languages: list of languages whose segments can be processed
|
||||
@numcorpora: number of language pair being processed
|
||||
@self.inputdir: directory whose files will be treated
|
||||
@self.outputfile: base name of the resulting corpora files
|
||||
@self.errors:output file indicating the types of error that occurred in each processed TMX file
|
||||
@self.startinglanguage: something like 'EN-GB'
|
||||
@self.destinationlanguage: something like 'FR-FR'
|
||||
@lang1: code of the starting language
|
||||
@lang2: code of the destination language
|
||||
@self.errortypes: variable that stocks the types of errors detected in the TMX file that is being processed
|
||||
@self.wroteactions: variable that indicates whether the actions files has already been written to
|
||||
"""
|
||||
|
||||
print 'Extract Some Corpora: started at '+strftime('%H-%M-%S')
|
||||
self.presentfile=''
|
||||
self.numtus=0
|
||||
currdir=os.getcwd()
|
||||
#... load the file ("LanguageCodes.txt") with the list of languages that the program can process
|
||||
try:
|
||||
pairsoflanguages=open(currdir+r'\LanguagePairs.txt','r+').readlines()
|
||||
except:
|
||||
# If the languages file doesn't exist in the program directory, alert user that it is essential for the good working of the program and exit
|
||||
result = dialog.alertDialog(self, 'The file "LanguagePairs.txt" is missing. The program will now close.', 'Essential file missing')
|
||||
sys.exit()
|
||||
#remove end of line marker from each line in "LanguageCodes.txt"
|
||||
if pairsoflanguages:
|
||||
for item in range(len(pairsoflanguages)):
|
||||
pairsoflanguages[item]=pairsoflanguages[item].strip()
|
||||
pos=pairsoflanguages[item].find("/")
|
||||
pairsoflanguages[item]=(pairsoflanguages[item][:pos],pairsoflanguages[item][pos+1:])
|
||||
else:
|
||||
# If the languages file is empty, alert user that it is essential for the good working of the program and exit
|
||||
result = dialog.alertDialog(self, 'The file "LanguagePairs.txt" is an essential file and is empty. The program will now close.', 'Empty file')
|
||||
sys.exit()
|
||||
|
||||
#if the directory where TMX files (@inputdir) or the base name of the output files were not previously chosen, open a dialog box explaining
|
||||
#the conditions that have to be met so that the extraction can be made and do nothing...
|
||||
if (self.inputdir=='') or (self.outputfile==''):
|
||||
result = dialog.alertDialog(self, 'In order to extract all corpora, you need to:\n\n 1) indicate the directory where the TMX files are, and\n ' \
|
||||
+ '2) the base name of the output files.', 'Error')
|
||||
#...else, go ahead
|
||||
else:
|
||||
numcorpora=0
|
||||
for (lang1,lang2) in pairsoflanguages:
|
||||
if lang1<>lang2:
|
||||
print lang1+'/'+lang2+' corpus being created...'
|
||||
self.errortypes=''
|
||||
numcorpora=numcorpora+1
|
||||
#get the startinglanguage code (e.g.: "EN-GB")
|
||||
self.startinglanguage=lang1
|
||||
#get the destinationlanguage code
|
||||
self.destinationlanguage=lang2
|
||||
try:
|
||||
self.errors=open(self.outputpath+'\\_processing_info\\'+self.startinglanguage+ '-'+self.destinationlanguage+'_'+'errors.txt','w+')
|
||||
except:
|
||||
pass
|
||||
self.statusBar.text='Language pair '+str(numcorpora)+' being processed. Please wait.'
|
||||
#Launch the segment extraction
|
||||
self.numtus=0
|
||||
self.wroteactions=False
|
||||
self.getallsegments()
|
||||
# if any error up to now, add the name of the TMX file to the output file @errors
|
||||
if self.errortypes:
|
||||
try:
|
||||
self.errors.write(self.presentfile.encode('utf_8','replace')+':\n'+self.errortypes.encode('utf_8','replace'))
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
self.errors.close()
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
result = dialog.alertDialog(self, 'A bilingual corpus involves two different languages. The pair "'+lang1+'/'+lang2 + \
|
||||
'" will not be processed.', 'Alert')
|
||||
self.statusBar.text='Processing finished.'
|
||||
#Open dialog box telling that processing is finished and where can the resulting files be found
|
||||
self.inputdir=''
|
||||
self.outputfile=''
|
||||
self.outputpath=''
|
||||
print 'Extract Some Corpora: finished at '+strftime('%H-%M-%S')
|
||||
result = dialog.alertDialog(self, 'Results found in: '+ self.outputpath+'.', 'Processing done')
|
||||
|
||||
def on_menuFileExtractSomeCorpora_select(self, event):
|
||||
self.ExtractSomeCorpora()
|
||||
def on_btnExtractSomeCorpora_mouseClick(self, event):
|
||||
self.ExtractSomeCorpora()
|
||||
|
||||
def on_menuHelpHelp_select(self, event):
|
||||
try:
|
||||
f = open('_READ_ME_FIRST.txt', "r")
|
||||
msg = f.read()
|
||||
result = dialog.scrolledMessageDialog(self, msg, 'readme.txt')
|
||||
except:
|
||||
result = dialog.alertDialog(self, 'Help file missing', 'Problem with the Help file')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = model.Application(Extract_TMX_Corpus)
|
||||
app.MainLoop()
|
@ -1,141 +0,0 @@
|
||||
{'application':{'type':'Application',
|
||||
'name':'Extract_TMX_Corpus',
|
||||
'backgrounds': [
|
||||
{'type':'Background',
|
||||
'name':'bgExtract_TMX_Corpus',
|
||||
'title':u'Extract_TMX_Corpus',
|
||||
'size':(275, 410),
|
||||
'statusBar':1,
|
||||
|
||||
'menubar': {'type':'MenuBar',
|
||||
'menus': [
|
||||
{'type':'Menu',
|
||||
'name':'menuFile',
|
||||
'label':'&File',
|
||||
'items': [
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileSelectDirectory',
|
||||
'label':u'Select &input/output directory...\tCtrl+I',
|
||||
'command':'SelectListOfDirectories',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'menuGetOutputFileBaseName',
|
||||
'label':u'Get &output file base name...\tCtrl+O',
|
||||
'command':'GetOutputFileBaseName',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'fileSep1',
|
||||
'label':'-',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileExtractCorpus',
|
||||
'label':u'&Extract corpus\tCtrl+E',
|
||||
'command':'ExtractCorpus',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileExtractSomeCorpora',
|
||||
'label':u'Extract &some corpora\tCtrl+S',
|
||||
'command':'ExtractSomeCorpora',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileExtractAllCorpora',
|
||||
'label':u'Extract &all corpora\tCtrl+A',
|
||||
'command':'ExtractAllCorpora',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'fileSep2',
|
||||
'label':u'-',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileExit',
|
||||
'label':'E&xit\tAlt+X',
|
||||
'command':'Doexit',
|
||||
},
|
||||
]
|
||||
},
|
||||
{'type':'Menu',
|
||||
'name':'menuHelp',
|
||||
'label':u'&Help',
|
||||
'items': [
|
||||
{'type':'MenuItem',
|
||||
'name':'menuHelpHelp',
|
||||
'label':u'&Help...\tCtrl+H',
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
'components': [
|
||||
|
||||
{'type':'Button',
|
||||
'name':'btnExtractSomeCorpora',
|
||||
'position':(18, 267),
|
||||
'size':(225, 25),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'label':u'Extract some corpora',
|
||||
},
|
||||
|
||||
{'type':'Button',
|
||||
'name':'btnExtractAllCorpora',
|
||||
'position':(18, 233),
|
||||
'size':(225, 25),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'label':u'Extract all corpora',
|
||||
},
|
||||
|
||||
{'type':'StaticText',
|
||||
'name':'StaticText3',
|
||||
'position':(18, 107),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'text':u'Destination Language:',
|
||||
},
|
||||
|
||||
{'type':'ComboBox',
|
||||
'name':'cbDestinationLanguage',
|
||||
'position':(18, 129),
|
||||
'size':(225, -1),
|
||||
'items':[],
|
||||
},
|
||||
|
||||
{'type':'Button',
|
||||
'name':'btnSelectDirectory',
|
||||
'position':(18, 19),
|
||||
'size':(225, 25),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'label':u'Select input / output directory...',
|
||||
},
|
||||
|
||||
{'type':'ComboBox',
|
||||
'name':'cbStartingLanguage',
|
||||
'position':(18, 74),
|
||||
'size':(225, -1),
|
||||
'items':[u'DE-PT', u'EN-PT', u'ES-PT', u'FR-PT'],
|
||||
},
|
||||
|
||||
{'type':'Button',
|
||||
'name':'btnGetOutputFileBaseName',
|
||||
'position':(18, 166),
|
||||
'size':(225, 25),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'label':u'Select base name of output file...',
|
||||
},
|
||||
|
||||
{'type':'Button',
|
||||
'name':'btnExtractCorpus',
|
||||
'position':(18, 200),
|
||||
'size':(225, 25),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'label':u'Extract one corpus',
|
||||
},
|
||||
|
||||
{'type':'StaticText',
|
||||
'name':'StaticText1',
|
||||
'position':(18, 53),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'text':u'Starting Language:',
|
||||
},
|
||||
|
||||
] # end components
|
||||
} # end background
|
||||
] # end backgrounds
|
||||
} }
|
@ -1,22 +0,0 @@
|
||||
BG-01
|
||||
CS-01
|
||||
DA-01
|
||||
DE-DE
|
||||
EL-01
|
||||
EN-GB
|
||||
ES-ES
|
||||
ET-01
|
||||
FI-01
|
||||
FR-FR
|
||||
HU-01
|
||||
IT-IT
|
||||
LT-01
|
||||
LV-01
|
||||
MT-01
|
||||
NL-NL
|
||||
PL-01
|
||||
PT-PT
|
||||
RO-RO
|
||||
SK-01
|
||||
SL-01
|
||||
SV-SE
|
@ -1,3 +0,0 @@
|
||||
BG-01/CS-01
|
||||
FR-FR/PT-PT
|
||||
EN-GB/LT-01
|
@ -1,119 +0,0 @@
|
||||
Summary:
|
||||
PURPOSE
|
||||
PERFORMANCE
|
||||
REQUIREMENTS
|
||||
INSTALLATION
|
||||
HOW TO USE
|
||||
GETTING THE RESULTS
|
||||
THANKS
|
||||
LICENSE
|
||||
|
||||
****************************************************************************
|
||||
PURPOSE:
|
||||
****************************************************************************
|
||||
Extract_Tmx_Corpus_1.043 is a Windows program (Windows 7, Vista and XP supported) that enables translators not necessarily with a deep knowledge of linguistic tools to create highly customised corpora that can be used with the Moses machine translation system and with other systems. Some users call it "et cetera", playing a bit with its initials (ETC) and meaning that it can treat a never-ending number of files.
|
||||
|
||||
In order to create corpora that are most useful to train machine translation systems, one should strive to include segments that are relevant for the task in hand. One of the ways of finding such segments could involve the usage of previous translation memory files (TMX files). This way the corpora could be customised for the person or for the type of task in question. The present program uses such files as input.
|
||||
|
||||
The program can create strictly aligned corpora for a single pair of languages, several pairs of languages or all the pairs of languages contained in the TMX files.
|
||||
|
||||
The program creates 2 separate files (UTF-8 format; Unix line endings) for each language pair that it processes: one for the starting language and another for the destination language. The lines of a given TMX translation unit are placed in strictly the same line in both files. The program suppresses empty TMX translation units, as well as those where the text for the first language is the same as that of the second language (like translation units consisting solely of numbers, or those in which the first language segment has not been translated into the second language). If you are interested in another format of corpus, it should be relatively easy to adapt this format to the format you are interested in.
|
||||
|
||||
The program also informs about errors that might occur during processing and creates a file that lists the name(s) of the TMX files that caused them, as well as a separate one listing the files successfully treated and the number of segments extracted for the language pair.
|
||||
|
||||
****************************************************************************
|
||||
PERFORMANCE:
|
||||
****************************************************************************
|
||||
The program can process very large numbers of TMX files (tens of thousands or more). It can also process extremely big TMX files (500 MB or more; it successfully processed a 2,3 GB file). The extraction of the corpus of a pair of languages in a very large (6,15 GB) set of TMX files took approximately 45 minutes in a Intel Core 2 Solo U3500 computer @ 1.4 GHz with 4 GB RAM.
|
||||
|
||||
The starting language and the destination language segments can be in any order in the TMX files (e.g., the starting language segment may be found either before or after the destination language segment in one, several or all translation units of the TMX file).
|
||||
|
||||
The program accepts and preserves text in any language (including special diacritical characters), but has only been tested with European Union official languages.
|
||||
****************************************************************************
|
||||
REQUIREMENTS:
|
||||
****************************************************************************
|
||||
These requirements only apply if you want to use the program from source. If you have downloaded the Windows executable you do not have to do anything.
|
||||
The program requires the following to be pre-installed in your computer:
|
||||
|
||||
1) Python 2.5 (http://www.python.org/download/releases/2.5.4/);
|
||||
NOTE1: the program should work with Python 2.6, but has not been tested with it.
|
||||
NOTE2: if you use Windows Vista, launch the following installation programs by right-clicking their file in Windows Explorer and choosing the command "Execute as administrator" in the contextual menu.
|
||||
2) wxPython 2.8, Unicode version (http://www.wxpython.org/download.php);
|
||||
3) Pythoncard 0.8.2 (http://sourceforge.net/projects/pythoncard/files/PythonCard/0.8.2/PythonCard-0.8.2.win32.exe/download)
|
||||
|
||||
****************************************************************************
|
||||
INSTALLATION:
|
||||
****************************************************************************
|
||||
1) Download the Extract_TMX_Corpus_1.043.exe file.
|
||||
2) Double-click it and follow the wizard instructions.
|
||||
***IMPORTANT***: Never erase the file "LanguageCodes.txt" in that directory. It is necessary for telling the program the languages that it has to process. If your TMX files use language codes that are different from those contained in this file, please replace the codes contained in the file with the codes used in your TMX files. You can always add or delete new codes to this file (when the program is not running).
|
||||
|
||||
****************************************************************************
|
||||
HOW TO USE:
|
||||
****************************************************************************
|
||||
1) Create a directory where you will copy the TMX files that you want to process.
|
||||
2) Copy the TMX files to that directory.
|
||||
Note: If you do not have such files, try the following site: http://langtech.jrc.it/DGT-TM.html#Download. It contains the European Union DGT's Translation Memory, containing legislative documents of the European Union. For more details, see http://wt.jrc.it/lt/Acquis/DGT_TU_1.0/data/. These files are compressed in zip format and need to be unzipped before they can be used.
|
||||
3) Launch the program.
|
||||
4) Operate on the main window of the program in the direction from top to bottom:
|
||||
a) Click the "Select input/output directory" button to tell the root directory where the TMX files are (this directory can have subdirectories, all of which will also be processed), as well as where the output files produced by the program will be placed;
|
||||
|
||||
|
||||
NOTE: Please take note of this directory because the result files will also be placed there.
|
||||
b) In case you want to extract a ***single*** pair of languages, choose them in the "Starting Language" and "Destination Language" comboboxes. Do nothing if you want to extract more than one pair of languages.
|
||||
c) Click the "Select base name of output file" button and choose a base name for the output files (default: "Corpus.txt").
|
||||
Note: This base name is used to compose the names of the output files, which will also include the names of the starting and destination languages. If you accept the default "Corpus.txt" and choose "EN-GB" as starting language and "PT-PT" as destination language, for that corpus pair the respective corpora files will be named, respectively, "EN-GB (PT-PT)_Corpus.txt" and "PT-PT (EN-GB)_Corpus.txt".
|
||||
***TIP***: The base name is useful for getting different names for different corpora of the same language.
|
||||
d) Click one (***just one***) of the following buttons:
|
||||
- "Extract one corpus": this creates a single pair of strictly aligned corpora in the languages chosen in the "Starting Language" and "Destination Language" comboboxes;
|
||||
-"Extract all corpora": this extracts all the combination pairs of languages for all the languages available in the "Starting Language" and "Destination language" comboboxes; if a language pair does not have segments of both languages in all of the translation units of all the TMX files, the result will be two empty corpora files for that language pair. If, however, there is just a single relevant translation unit, the corpus won’t be empty.
|
||||
-"Extract some corpora": this extracts the pairs of languages listed in the file "LanguagePairs.txt". Each line of this file has the following structure:
|
||||
{Starting Language}/{Destination Language}.
|
||||
|
||||
Here is an example of a file with 2 lines:
|
||||
|
||||
EN-GB/PT-PT
|
||||
FR-FR/PT-PT
|
||||
|
||||
This will create corpora for 4 pairs of languages: EN-PT, PT-EN and FR-PT and PT-FR. A sample "LanguagePairs.txt" comes with the program to serve as an example. Customise it to your needs respecting the syntax described above.
|
||||
NOTE: Never erase the "LanguagePairs.txt" file and always make sure that each pair of languages that you choose does exist in your TMX files. Otherwise, you won't get any results.
|
||||
|
||||
The “Extract some corpora” and “Extract all corpora” functions are particularly useful if you want to prepare corpora for several or many language pairs. If your TMX files have translation units in all of the languages you are interested in, put them in a single directory (it can have subdirectories) and use those functions!
|
||||
|
||||
****************************************************************************
|
||||
GETTING THE RESULTS:
|
||||
****************************************************************************
|
||||
The results are the aligned corpora files, as well as other files indicating how well the processing was done.
|
||||
|
||||
When the processing is finished, you will find the corpora files in the directory you have chosen when you selected "Select input/output directory". In the "_processing_info" subdirectory of that directory you will find one or more *errors.txt file(s), listing the name of the TMX files that caused an error, and *actions.txt file(s), listing the files that were successfully processed as well as the number of translation units extracted.
|
||||
|
||||
If you ask for the extraction of several corpora at once, you'll get lots of corpora files. If you feel somewhat confused by that abundance, please note 2 things:
|
||||
a) If you sort the files by order of modified date, you'll reconstitute the chronological order in which the corpora were made (corpora are always made in pairs one after the other);
|
||||
b) The name of the corpora file has the following structure:
|
||||
|
||||
{Language of the segments} ({Language with which they are aligned})_{Base name of the corpus}.txt
|
||||
Ex: the file "BG-01 (MT-01)_Corpus.txt" has segments in the BG-01 (Bulgarian) language that also have a translation in the MT-01 (Maltese) language and corresponds to the corpus whose base name is "Corpus.txt". There should be an equivalent "MT-01 (BG-01)_Corpus.txt", this time with all the Maltese segments that have a translation in Bulgarian. Together, these 2 files constitute an aligned corpus ready to be fed to Moses.
|
||||
|
||||
You can now feed Moses your customised corpora :-)
|
||||
****************************************************************************
|
||||
THANKS:
|
||||
****************************************************************************
|
||||
Thanks to Gary Daine, who pointed out a way to improve one of the regex expressions used in the code and suggested changes needed for it to cover more translation memories.
|
||||
****************************************************************************
|
||||
LICENSE:
|
||||
****************************************************************************
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation (version 3 of the License).
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
@ -1,22 +0,0 @@
|
||||
BG-01
|
||||
CS-01
|
||||
DA-01
|
||||
DE-DE
|
||||
EL-01
|
||||
EN-GB
|
||||
ES-ES
|
||||
ET-01
|
||||
FI-01
|
||||
FR-FR
|
||||
HU-01
|
||||
IT-IT
|
||||
LT-01
|
||||
LV-01
|
||||
MT-01
|
||||
NL-NL
|
||||
PL-01
|
||||
PT-PT
|
||||
RO-RO
|
||||
SK-01
|
||||
SL-01
|
||||
SV-SE
|
@ -1,166 +0,0 @@
|
||||
# -*- coding: utf_8 -*-
|
||||
"""This program is used to prepare TMX files from corpora composed of 2 files for each language pair,
|
||||
where the position of a segment in the first language file is exactly the same as in the second
|
||||
language file.
|
||||
|
||||
The program requires that Pythoncard and wxPython (as well as Python) be previously installed.
|
||||
|
||||
Copyright 2009, 2010 João Luís A. C. Rosas
|
||||
|
||||
Distributed under GNU GPL v3 licence (see http://www.gnu.org/licenses/)
|
||||
|
||||
E-mail: joao.luis.rosas@gmail.com """
|
||||
|
||||
__version__ = "$Revision: 1.032$"
|
||||
__date__ = "$Date: 2010/02/25$"
|
||||
__author__="$João Luís A. C. Rosas$"
|
||||
|
||||
from PythonCard import clipboard, dialog, graphic, model
|
||||
from PythonCard.components import button, combobox,statictext,checkbox,staticbox
|
||||
import wx
|
||||
import os, re
|
||||
import string
|
||||
import sys
|
||||
from time import strftime
|
||||
import codecs
|
||||
import sys
|
||||
|
||||
class Moses2TMX(model.Background):
|
||||
|
||||
def on_initialize(self, event):
|
||||
self.inputdir=''
|
||||
#Get directory where program file is and ...
|
||||
currdir=os.getcwd()
|
||||
#... load the file ("LanguageCodes.txt") with the list of languages that the program can process
|
||||
try:
|
||||
self.languages=open(currdir+r'\LanguageCodes.txt','r+').readlines()
|
||||
except:
|
||||
# If the languages file doesn't exist in the program directory, alert user that it is essential for the good working of the program and exit
|
||||
result = dialog.alertDialog(self, 'The file "LanguageCodes.txt" is missing. The program will now close.', 'Essential file missing')
|
||||
sys.exit()
|
||||
#remove end of line marker from each line in "LanguageCodes.txt"
|
||||
for lang in range(len(self.languages)):
|
||||
self.languages[lang]=self.languages[lang].rstrip()
|
||||
self.lang1code=''
|
||||
self.lang2code=''
|
||||
#Insert list of language names in appropriate program window's combo boxes
|
||||
self.components.cbStartingLanguage.items=self.languages
|
||||
self.components.cbDestinationLanguage.items=self.languages
|
||||
|
||||
def CreateTMX(self, name):
|
||||
print 'Started at '+strftime('%H-%M-%S')
|
||||
#get the startinglanguage name (e.g.: "EN-GB") from the program window
|
||||
self.lang1code=self.components.cbStartingLanguage.text
|
||||
#get the destinationlanguage name from the program window
|
||||
self.lang2code=self.components.cbDestinationLanguage.text
|
||||
print name+'.'+self.lang2code[:2].lower()
|
||||
e=codecs.open(name,'r',"utf-8","strict")
|
||||
f=codecs.open(name+'.'+self.lang2code[:2].lower()+'.moses','r',"utf-8","strict")
|
||||
a=codecs.open(name+'.tmp','w',"utf-8","strict")
|
||||
b=codecs.open(name+'.'+self.lang2code[:2].lower()+'.moses.tmp','w',"utf-8","strict")
|
||||
for line in e:
|
||||
if line.strip():
|
||||
a.write(line)
|
||||
for line in f:
|
||||
if line.strip():
|
||||
b.write(line)
|
||||
a=codecs.open(name+'.tmp','r',"utf-8","strict")
|
||||
b=codecs.open(name+'.'+self.lang2code[:2].lower()+'.moses.tmp','r',"utf-8","strict")
|
||||
g=codecs.open(name+'.tmx','w','utf-16','strict')
|
||||
g.write('<?xml version="1.0" ?>\r\n<!DOCTYPE tmx SYSTEM "tmx14.dtd">\r\n<tmx version="version 1.4">\r\n\r\n<header\r\ncreationtool="moses2tmx"\r\ncreationtoolversion="1.032"\r\nsegtype="sentence"\r\ndatatype="PlainText"\r\nadminlang="EN-US"\r\nsrclang="'+self.lang1code+'"\r\n>\r\n</header>\r\n\r\n<body>\r\n')
|
||||
parar=0
|
||||
while True:
|
||||
self.ling1segm=a.readline().strip()
|
||||
self.ling2segm=b.readline().strip()
|
||||
if not self.ling1segm:
|
||||
break
|
||||
elif not self.ling2segm:
|
||||
break
|
||||
else:
|
||||
try:
|
||||
g.write('<tu creationid="MT!">\r\n<prop type="Txt::Translator">Moses</prop>\r\n<tuv xml:lang="'+self.lang1code+'">\r\n<seg>'+self.ling1segm+'</seg>\r\n</tuv>\r\n<tuv xml:lang="'+self.lang2code+ \
|
||||
'">\r\n<seg>'+self.ling2segm+'</seg>\r\n</tuv>\r\n</tu>\r\n\r\n')
|
||||
except:
|
||||
pass
|
||||
a.close()
|
||||
b.close()
|
||||
e.close()
|
||||
f.close()
|
||||
g.write('</body>\r\n</tmx>\r\n')
|
||||
g.close()
|
||||
#os.remove(name)
|
||||
#os.remove(name+'.'+self.lang2code[:2].lower()+'.moses')
|
||||
os.remove(name+'.tmp')
|
||||
os.remove(name+'.'+self.lang2code[:2].lower()+'.moses.tmp')
|
||||
|
||||
def createTMXs(self):
|
||||
try:
|
||||
# Get a list of all TMX files that need to be processed
|
||||
fileslist=self.locate('*.moses',self.inputdir)
|
||||
except:
|
||||
# if any error up to now, add the name of the TMX file to the output file @errors
|
||||
self.errortypes=self.errortypes+' - Get All Segments: creation of output files error\n'
|
||||
if fileslist:
|
||||
# For each relevant TMX file ...
|
||||
for self.presentfile in fileslist:
|
||||
filename=self.presentfile[:-9]
|
||||
#print filename
|
||||
self.CreateTMX(filename)
|
||||
print 'Finished at '+strftime('%H-%M-%S')
|
||||
result = dialog.alertDialog(self, 'Processing done.', 'Processing Done')
|
||||
|
||||
def on_btnCreateTMX_mouseClick(self, event):
|
||||
self.createTMXs()
|
||||
|
||||
def on_menuFileCreateTMXFiles_select(self, event):
|
||||
self.createTMXs()
|
||||
|
||||
def on_btnSelectLang1File_mouseClick(self, event):
|
||||
self.input1=self.GetInputFileName()
|
||||
|
||||
def on_btnSelectLang2File_mouseClick(self, event):
|
||||
self.input2=self.GetInputFileName()
|
||||
|
||||
def locate(self,pattern, basedir):
|
||||
"""Locate all files matching supplied filename pattern in and below
|
||||
supplied root directory.
|
||||
|
||||
@pattern: something like '*.tmx'
|
||||
@basedir:whole directory to be treated
|
||||
"""
|
||||
import fnmatch
|
||||
for path, dirs, files in os.walk(os.path.abspath(basedir)):
|
||||
for filename in fnmatch.filter(files, pattern):
|
||||
yield os.path.join(path, filename)
|
||||
|
||||
def SelectDirectory(self):
|
||||
"""Select the directory where the files to be processed are
|
||||
|
||||
@result: object returned by the dialog window with attributes accepted (true if user clicked OK button, false otherwise) and
|
||||
path (list of strings containing the full pathnames to all files selected by the user)
|
||||
@self.inputdir: directory where files to be processed are (and where output files will be written)
|
||||
@self.statusBar.text: text displayed in the program window status bar"""
|
||||
|
||||
result= dialog.directoryDialog(self, 'Choose a directory', 'a')
|
||||
if result.accepted:
|
||||
self.inputdir=result.path
|
||||
self.statusBar.text=self.inputdir+' selected.'
|
||||
|
||||
def on_menuFileSelectDirectory_select(self, event):
|
||||
self.SelectDirectory()
|
||||
|
||||
def on_btnSelectDirectory_mouseClick(self, event):
|
||||
self.SelectDirectory()
|
||||
|
||||
def on_menuHelpShowHelp_select(self, event):
|
||||
f = open('_READ_ME_FIRST.txt', "r")
|
||||
msg = f.read()
|
||||
result = dialog.scrolledMessageDialog(self, msg, '_READ_ME_FIRST.txt')
|
||||
|
||||
def on_menuFileExit_select(self, event):
|
||||
sys.exit()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = model.Application(Moses2TMX)
|
||||
app.MainLoop()
|
@ -1,95 +0,0 @@
|
||||
{'application':{'type':'Application',
|
||||
'name':'Moses2TMX',
|
||||
'backgrounds': [
|
||||
{'type':'Background',
|
||||
'name':'bgMoses2TMX',
|
||||
'title':u'Moses2TMX-1.032',
|
||||
'size':(277, 307),
|
||||
'statusBar':1,
|
||||
|
||||
'menubar': {'type':'MenuBar',
|
||||
'menus': [
|
||||
{'type':'Menu',
|
||||
'name':'menuFile',
|
||||
'label':u'&File',
|
||||
'items': [
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileSelectDirectory',
|
||||
'label':u'Select &Directory ...\tAlt+D',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileCreateTMXFiles',
|
||||
'label':u'&Create TMX Files\tAlt+C',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'Sep1',
|
||||
'label':u'-',
|
||||
},
|
||||
{'type':'MenuItem',
|
||||
'name':'menuFileExit',
|
||||
'label':u'&Exit\tAlt+E',
|
||||
},
|
||||
]
|
||||
},
|
||||
{'type':'Menu',
|
||||
'name':'menuHelp',
|
||||
'label':u'&Help',
|
||||
'items': [
|
||||
{'type':'MenuItem',
|
||||
'name':'menuHelpShowHelp',
|
||||
'label':u'&Show Help\tAlt+S',
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
'components': [
|
||||
|
||||
{'type':'Button',
|
||||
'name':'btnSelectDirectory',
|
||||
'position':(15, 15),
|
||||
'size':(225, 25),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'label':u'Select Directory ...',
|
||||
},
|
||||
|
||||
{'type':'StaticText',
|
||||
'name':'StaticText3',
|
||||
'position':(17, 106),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'text':u'Target Language:',
|
||||
},
|
||||
|
||||
{'type':'ComboBox',
|
||||
'name':'cbStartingLanguage',
|
||||
'position':(18, 75),
|
||||
'size':(70, -1),
|
||||
'items':[],
|
||||
},
|
||||
|
||||
{'type':'ComboBox',
|
||||
'name':'cbDestinationLanguage',
|
||||
'position':(17, 123),
|
||||
'size':(70, -1),
|
||||
'items':[u'DE-PT', u'EN-PT', u'ES-PT', u'FR-PT'],
|
||||
},
|
||||
|
||||
{'type':'Button',
|
||||
'name':'btnCreateTMX',
|
||||
'position':(20, 160),
|
||||
'size':(225, 25),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'label':u'Create TMX Files',
|
||||
},
|
||||
|
||||
{'type':'StaticText',
|
||||
'name':'StaticText1',
|
||||
'position':(18, 56),
|
||||
'font':{'faceName': u'Arial', 'family': 'sansSerif', 'size': 10},
|
||||
'text':u'Source Language:',
|
||||
},
|
||||
|
||||
] # end components
|
||||
} # end background
|
||||
] # end backgrounds
|
||||
} }
|
@ -1,82 +0,0 @@
|
||||
Summary:
|
||||
PURPOSE
|
||||
REQUIREMENTS
|
||||
INSTALLATION
|
||||
HOW TO USE
|
||||
LICENSE
|
||||
|
||||
|
||||
|
||||
***********************************************************************************************************
|
||||
PURPOSE:
|
||||
***********************************************************************************************************
|
||||
Moses2TMX is a Windows program (Windows7, Vista and XP supported) that enables translators not necessarily with a deep knowledge of linguistic tools to create TMX files from a Moses corpus or from any other corpus made up of 2 separate files, one for the source language and another for the target language, whose lines are strictly aligned.
|
||||
|
||||
The program processes a whole directory containing source language and corresponding target language documents and creates 1 TMX file (UTF-16 format; Windows line endings) for each document pair that it processes.
|
||||
|
||||
The program accepts and preserves text in any language (including special diacritical characters), but has only been tested with European Union official languages.
|
||||
|
||||
The program is specifically intended to work with the output of a series of Linux scripts together called Moses-for-Mere-Mortals.
|
||||
***********************************************************************************************************
|
||||
REQUIREMENTS:
|
||||
***********************************************************************************************************
|
||||
The program requires the following to be pre-installed in your computer:
|
||||
|
||||
1) Python 2.5 (http://www.python.org/download/releases/2.5.4/);
|
||||
NOTE1: the program should work with Python 2.6, but has not been tested with it.
|
||||
NOTE2: if you use Windows Vista, launch the following installation programs by right-clicking their file in Windows Explorer and choosing the command "Execute as administrator" in the contextual menu.
|
||||
2) wxPython 2.8, Unicode version (http://www.wxpython.org/download.php);
|
||||
3) Pythoncard 0.8.2 (http://sourceforge.net/projects/pythoncard/files/PythonCard/0.8.2/PythonCard-0.8.2.win32.exe/download)
|
||||
|
||||
***********************************************************************************************************
|
||||
INSTALLATION:
|
||||
***********************************************************************************************************
|
||||
1) Download the Moses2TMX.exe file in a directory of your choice.
|
||||
2) Double-click Moses2TMX.exe and follow the wizard's instructions.
|
||||
***IMPORTANT***: Never erase the file "LanguageCodes.txt" in that directory. It is necessary for telling the program the languages that it has to process. If your TMX files use language codes that are different from those contained in this file, please replace the codes contained in the file with the codes used in your TMX files. You can always add or delete new codes to this file (when the program is not running).
|
||||
|
||||
|
||||
***********************************************************************************************************
|
||||
HOW TO USE:
|
||||
***********************************************************************************************************
|
||||
1) Create a directory where you will copy the files that you want to process.
|
||||
2) Copy the source and target language documents that you want to process to that directory.
|
||||
NOTE -YOU HAVE TO RESPECT SOME NAMING CONVENTIONS IN ORDER TO BE ABLE TO USE THIS PROGRAM:
|
||||
a) the target documents have to have follow the following convention:
|
||||
|
||||
{basename}.{abbreviation of target language}.moses
|
||||
|
||||
where {abbreviation of target language} is a ***2 character*** string containing the lowercased first 2 characters of any of the language codes present in the LanguageCodes.txt (present in the base directory of Moses2TMX)
|
||||
|
||||
Example: If {basename} = "200000" and the target language has a code "EN-GB" in the LanguageCodes.txt, then the name of the target file should be "200000.en.moses"
|
||||
|
||||
b) the source language document should have the name:
|
||||
|
||||
{basename}
|
||||
|
||||
Example: continuing the preceding example, the name of the corresponding source document should be "200000".
|
||||
|
||||
3) Launch the program as indicated above in the "Launching the program" section.
|
||||
4) Operate on the main window of the program in the direction from top to bottom:
|
||||
a) Click the "Select Directory..." button to indicate the directory containing all the source and corresponding target documents that you want to process;
|
||||
b) Indicate the languages of your files refers to in the "Source Language" and "Target Language" comboboxes.
|
||||
c) Click the Create TMX Files button
|
||||
|
||||
***********************************************************************************************************
|
||||
LICENSE:
|
||||
***********************************************************************************************************
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation (version 3 of the License).
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
@ -1,55 +0,0 @@
|
||||
/*
|
||||
all.css
|
||||
Generated by redsea 14
|
||||
Generated by redsea. See license and other details in http://dragoman.org/redsea
|
||||
*/
|
||||
body {
|
||||
margin : 3.5em ;
|
||||
padding-bottom : 1.6em ;
|
||||
border-bottom : 4px solid #990000 ;
|
||||
background-color : #fffff3 ;
|
||||
background-image : none ;
|
||||
color : black ;
|
||||
font-family : monospace ;
|
||||
font-size : 1.3em ;
|
||||
text-align : justify ;
|
||||
margin-top : 0.2em ;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-top : 0.6em ;
|
||||
margin-bottom : 0.1em ;
|
||||
border-bottom : 4px solid #990000 ;
|
||||
text-align : center ;
|
||||
font-size : 2.0em ;
|
||||
color : #770000 ;
|
||||
}
|
||||
|
||||
a:link {
|
||||
text-decoration : none ;
|
||||
color : #0000cc ;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
text-decoration : none ;
|
||||
color : #0000CC ;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration : none ;
|
||||
border-bottom : 2px solid #990000 ;
|
||||
}
|
||||
|
||||
table {
|
||||
margin : auto ;
|
||||
width : 95% ;
|
||||
}
|
||||
|
||||
td {
|
||||
padding : 0.5em ;
|
||||
}
|
||||
|
||||
td.feedback {
|
||||
height : 4.1em ;
|
||||
}
|
||||
/* +++ */
|
Before Width: | Height: | Size: 203 KiB |
@ -1,55 +0,0 @@
|
||||
/*
|
||||
all.css
|
||||
Generated by redsea 14
|
||||
Generated by redsea. See license and other details in http://dragoman.org/redsea
|
||||
*/
|
||||
body {
|
||||
margin : 3.5em ;
|
||||
padding-bottom : 1.6em ;
|
||||
border-bottom : 4px solid #990000 ;
|
||||
background-color : #fffff3 ;
|
||||
background-image : none ;
|
||||
color : black ;
|
||||
font-family : monospace ;
|
||||
font-size : 1.3em ;
|
||||
text-align : justify ;
|
||||
margin-top : 0.2em ;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-top : 0.6em ;
|
||||
margin-bottom : 0.1em ;
|
||||
border-bottom : 4px solid #990000 ;
|
||||
text-align : center ;
|
||||
font-size : 2.0em ;
|
||||
color : #770000 ;
|
||||
}
|
||||
|
||||
a:link {
|
||||
text-decoration : none ;
|
||||
color : #0000cc ;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
text-decoration : none ;
|
||||
color : #0000CC ;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration : none ;
|
||||
border-bottom : 2px solid #990000 ;
|
||||
}
|
||||
|
||||
table {
|
||||
margin : auto ;
|
||||
width : 95% ;
|
||||
}
|
||||
|
||||
td {
|
||||
padding : 0.5em ;
|
||||
}
|
||||
|
||||
td.feedback {
|
||||
height : 4.1em ;
|
||||
}
|
||||
/* +++ */
|
@ -1,27 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC
|
||||
"-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
|
||||
>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Thanks</title>
|
||||
<link rel="stylesheet" href="all.css" type="text/css" media="all" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Thanks</h1>
|
||||
<ul>
|
||||
<li><B>Maria José Machado</B>, whose suggestions and research have influenced significantly the <I>scorer-moses-irstlm-randlm</I> script. She helped in the evaluation of Moses output in general and organised, together with Hilário, a comparative evaluation, made by professional translators, of the qualitative results of Google, Moses and a rule-based MT engine. She suggested a deep restructuring of the Help-Tutorial file. </li>
|
||||
<li><B>Hilário Leal Fontes</B>, who made very helpful suggestions and comprehensive tests. He is the author of the <I>breaking_prefixes.pt</I> script (for the Portuguese language). He has compiled the corpora that were used to train Moses and to test these scripts, including 2 very large corpora with 6.6 and 12 million <i>segments</i>. He has also revised the Help file.</li>
|
||||
<li><B>Tom Hoar</B>, who consolidated the previous documentation into the Quick-Start-Guide.doc to help users to get up to speed very quickly.</li>
|
||||
<li><B>Manuel Tomas Carrasco Benitez</B>, whose <a href="http://dragoman.org/xdossier/" >Xdossier</a> was used to create the pack of the Moses-for-Mere-Mortals files.</li>
|
||||
<li><B>Gary Daine</B>, who made helpful remarks and who contributed code for Extract_TMX_Corpus.</li>
|
||||
<li>Authors of the <a href="http://www.dlsi.ua.es/~mlf/fosmt-moses.html" >http://www.dlsi.ua.es/~mlf/fosmt-moses.html</a> (<b>Mikel Forcada</b> and <b>Francis Tyers</b>) and of the <a href="http://www.statmt.org/moses_steps.html" >http://www.statmt.org/moses_steps.html</a> pages. These pages have helped me a lot in the first steps with Moses.</li>
|
||||
<li>Authors of the documentation of Moses, giza-pp, MGIZA, IRSTLM and RandLM; some of the commentaries of the present scripts describing the various settings include citations of them.</li>
|
||||
<li>European Commission's Joint Research Center and Directorate-General for Translation for the <a href="http://wt.jrc.it/lt/Acquis/DGT_TU_1.0/data/" >DGT-TM Acquis</a> - freely available on the JRC website and providing aligned corpora of about 1 million segments of Community law texts in 22 languages- which was used in the demonstration corpus. Please note that only European Community legislation printed in the paper edition of the Official Journal of the European Union is deemed authentic.</li>
|
||||
</ul>
|
||||
<P>
|
||||
<P>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,22 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC
|
||||
"-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
|
||||
>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Moses for Mere Mortals</title>
|
||||
<link rel="stylesheet" href="all.css" type="text/css" media="all" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Moses for Mere Mortals</h1>
|
||||
<ul>
|
||||
<li><a href="docs/Overview.jpeg">Overview</a></li>
|
||||
<li><a href="docs/Quick-Start-Guide.doc">Quick Start Guide</a></li>
|
||||
<li><a href="docs/Help-Tutorial.doc">Help-Tutorial</a></li>
|
||||
<li><a href="scripts">Scripts</a></li>
|
||||
<li><a href="data-files">Data Files</a></li>
|
||||
<li><a href="docs/thanks.html">Thanks</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
@ -1,557 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# create-1.37
|
||||
# copyright 2009,2010 João L. A. C. Rosas
|
||||
# date: 22/09/2010
|
||||
# licenced under the GPL licence, version 3
|
||||
# the Mosesdecoder (http://sourceforge.net/projects/mosesdecoder/), is a tool upon which this script depends that is licenced under the GNU Library or Lesser General Public License (LGPL)
|
||||
# Special thanks to Hilário Leal Fontes and Maria José Machado, who helped to test the script and made very helpful suggestions
|
||||
|
||||
# *** Purpose ***: this script downloads, compiles and installs Moses together with MGIZA, IRSTLM, RandLM, the Moses scripts and a demonstration corpus. Tested in in Ubuntu 10.04 LTS (http://releases.ubuntu.com/10.04/)
|
||||
|
||||
############################### REQUIREMENTS ################################
|
||||
# You should install the following packages (in Ubuntu 10.04 LTS: #
|
||||
# http://releases.ubuntu.com/10.04/) *** before launching *** this script: #
|
||||
# automake #
|
||||
# bison #
|
||||
# boost-build #
|
||||
# build-essential #
|
||||
# flex #
|
||||
# help2man #
|
||||
# libboost-all-dev #
|
||||
# libpthread-stubs0-dev #
|
||||
# libgc-dev #
|
||||
# libtool #
|
||||
# zlibc #
|
||||
# zlib1g-dev #
|
||||
# gawk #
|
||||
# tofrodos #
|
||||
#############################################################################
|
||||
|
||||
######################################################################################
|
||||
# The values of the variables that follow should be filled according to your needs: #
|
||||
######################################################################################
|
||||
#Full path of the base directory location of your Moses system
|
||||
mosesdir="$HOME/moses-irstlm-randlm"
|
||||
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
# !!! Please set $mosesnumprocessors to the number of processors of your computer !!!
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
#Number of processors in your computer
|
||||
mosesnumprocessors=1
|
||||
#Install small demo corpus: 1 = Install; Any other value = Do not install (!!! this will install a very small corpus that can be used to see what the scripts and Moses can do; if dodemocorpus is set to 1, this series of scripts will be able to use the demo corpus without you having to change their settings !!!)
|
||||
dodemocorpus=1
|
||||
#Remove the downloaded compressed packages and some directories no longer needed once the installation is done; 1 = remove the downloaded packages; any other value = do not remove those packages
|
||||
removedownloadedpackges=1
|
||||
######################################################################################
|
||||
# End of parameters that you should fill #
|
||||
######################################################################################
|
||||
|
||||
######################################################################################
|
||||
# DON'T CHANGE THE LINES THAT FOLLOW ... unless you know what you are doing! #
|
||||
######################################################################################
|
||||
#Present working directory
|
||||
prworkdir=$PWD
|
||||
#Full path of the directory where the tools (Moses, IRSTLM, RandLM) will be placed
|
||||
toolsdir=$mosesdir/tools
|
||||
|
||||
#create, if need be, some important directories
|
||||
if [ ! -d $mosesdir ]; then
|
||||
mkdir -p $mosesdir
|
||||
if [ ! -d $mosesdir ]; then
|
||||
echo "The $mosesdir directory could not be created. Please make sure that you have enough disk space and that the \$mosesdir setting of this script is a legal name and points to a location in which you have write permissions. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Directory with files used for corpus training, language model building, tuning, testing and recasing
|
||||
#if [ ! -d $mosesdir/corpora_for_training ]; then mkdir -p $mosesdir/corpora_for_training; fi
|
||||
|
||||
# Directory with the tools used (Moses, IRSTLM, RandLM, giza-pp, MGIZA, ...)
|
||||
if [ ! -d $toolsdir ]; then mkdir -p $toolsdir; fi
|
||||
|
||||
# Directory with new and modified scripts
|
||||
if [ ! -d $toolsdir/modified-scripts ]; then mkdir -p $toolsdir/modified-scripts; fi
|
||||
|
||||
# Directory with the reference (human-made) translation files
|
||||
#if [ ! -d $mosesdir/translation_reference ]; then mkdir -p $mosesdir/translation_reference; fi
|
||||
|
||||
# Directory with the files that need to be translated by Moses
|
||||
#if [ ! -d $mosesdir/translation_input ]; then mkdir -p $mosesdir/translation_input; fi
|
||||
|
||||
|
||||
#Addresses of packages used (*pack = name of package; *url = url of package; *dir = directory base name of decompressed, non-compiled package on disk; *newdir = base directory of compiled package on disk)
|
||||
#Name of the pack compressed file
|
||||
irstlmpack=irstlm-5.22.01.tar.gz
|
||||
#URL of package compressed file
|
||||
irstlmurl=http://heanet.dl.sourceforge.net/project/irstlm/irstlm/irstlm-5.22.01/$irstlmpack
|
||||
#Name of the decompressed package base directory
|
||||
irstlmdir=irstlm-5.22.01
|
||||
#Name of the compiled package base directory
|
||||
irstlmnewdir=irstlm
|
||||
randlmpack=randlm-v0.11.tar.gz
|
||||
randlmurl=http://kent.dl.sourceforge.net/project/randlm/randlm/randlm%20v0.11/$randlmpack
|
||||
randlmdir=randlm
|
||||
randlmnewdir=randlm
|
||||
mgizapack=mgiza-0.6.3-10-01-11.tar.gz
|
||||
mgizaurl=http://www.cs.cmu.edu/~qing/release/$mgizapack
|
||||
mgizadir=MGIZA
|
||||
mgizanewdir=mgiza
|
||||
mosespack=moses-2010-08-13.tgz
|
||||
mosesurl=http://sunet.dl.sourceforge.net/project/mosesdecoder/mosesdecoder/2010-08-13/$mosespack
|
||||
mosessoftdir=moses
|
||||
mosesnewdir=moses
|
||||
scriptspack=scripts.tgz
|
||||
scriptsurl=http://homepages.inf.ed.ac.uk/jschroe1/how-to/$scriptspack
|
||||
scriptsdir=scripts
|
||||
scriptsnewdir=scripts
|
||||
scorerpack=mteval-v11b.pl
|
||||
scorerurl=ftp://jaguar.ncsl.nist.gov/mt/resources/$scorerpack
|
||||
datapack=m3-data.tgz
|
||||
dataurl="http://www.statmt.org/moses/download/$datapack"
|
||||
|
||||
cd $PWD
|
||||
cd ..
|
||||
wget $dataurl
|
||||
tar -xzvf $datapack
|
||||
cp -r data-files/corpora_for_training $mosesdir
|
||||
cp -r data-files/translation_input $mosesdir
|
||||
cp -r data-files/translation_reference $mosesdir
|
||||
rm -f $datapack
|
||||
if [ ! -f $mosesdir/corpora_for_training/300000.en ]; then
|
||||
echo "Data files not correctly created. Exiting..."
|
||||
exit 0
|
||||
fi
|
||||
cd $toolsdir
|
||||
|
||||
|
||||
cd $toolsdir
|
||||
if [ ! -f $mosesdir/create.moses.log ]; then
|
||||
echo "did_irstlm=" > $mosesdir/create.moses.log
|
||||
echo "did_randlm=" >> $mosesdir/create.moses.log
|
||||
echo "did_mgiza=" >> $mosesdir/create.moses.log
|
||||
echo "did_moses=" >> $mosesdir/create.moses.log
|
||||
echo "did_mosesscripts=" >> $mosesdir/create.moses.log
|
||||
echo "did_newscripts=" >> $mosesdir/create.moses.log
|
||||
echo "did_scorer=" >> $mosesdir/create.moses.log
|
||||
echo "Download IRSTLM package"
|
||||
wget $irstlmurl
|
||||
if [ ! -f $irstlmpack ]; then
|
||||
echo "$irstlmpack pack not correctly downloaded. Please check your Internet connection. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
echo "Download RandLM package"
|
||||
wget $randlmurl
|
||||
echo "Download MGIZA package"
|
||||
wget $mgizaurl
|
||||
#echo "Download Moses package"
|
||||
#wget $mosesurl
|
||||
echo "Download Moses scripts package"
|
||||
wget $scriptsurl
|
||||
echo "Download scorer package"
|
||||
wget $scorerurl
|
||||
chmod -R +rwx $toolsdir/$scorerpack
|
||||
else
|
||||
. $mosesdir/create.moses.log
|
||||
if [ "$did_irstlm" = "0" ]; then
|
||||
if [ -f $toolsdir/$irstlmpack ]; then
|
||||
rm $toolsdir/$irstlmpack
|
||||
if [ -d $toolsdir/$irstlmdir ]; then
|
||||
rm -rf $toolsdir/$irstlmdir
|
||||
fi
|
||||
if [ -d $toolsdir/$irstlmnewdir ]; then
|
||||
rm -rf $toolsdir/$irstlmnewdir
|
||||
fi
|
||||
fi
|
||||
echo "Download IRSTLM package"
|
||||
wget $irstlmurl
|
||||
if [ ! -f $irstlmpack ]; then
|
||||
echo "$irstlmpack pack not correctly downloaded. Please check your Internet connection. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
if [ "$did_randlm" = "0" ]; then
|
||||
if [ -f $toolsdir/$randlmpack ]; then
|
||||
rm $toolsdir/$randlmpack
|
||||
if [ -d $toolsdir/$randlmdir ]; then
|
||||
rm -rf $toolsdir/$randlmdir
|
||||
fi
|
||||
if [ -d $toolsdir/$randlmnewdir ]; then
|
||||
rm -rf $toolsdir/$randlmnewdir
|
||||
fi
|
||||
fi
|
||||
echo "Download RandLM package"
|
||||
wget $randlmurl
|
||||
fi
|
||||
if [ "$did_mgiza" = "0" ]; then
|
||||
if [ -f $toolsdir/$mgizapack ]; then
|
||||
rm $toolsdir/$mgizapack
|
||||
if [ -d $toolsdir/$mgizadir ]; then
|
||||
rm -rf $toolsdir/$mgizadir
|
||||
fi
|
||||
if [ -d $toolsdir/$mgizanewdir ]; then
|
||||
rm -rf $toolsdir/$mgizanewdir
|
||||
fi
|
||||
echo "Download MGIZA package"
|
||||
wget $mgizaurl
|
||||
fi
|
||||
fi
|
||||
if [ "$did_moses" = "0" ]; then
|
||||
if [ -f $toolsdir/$mosespack ]; then
|
||||
rm $toolsdir/$mosespack
|
||||
if [ -d $toolsdir/$mosessoftdir ]; then
|
||||
rm -rf $toolsdir/$mosessoftdir
|
||||
fi
|
||||
if [ -d $toolsdir/$mosesnewdir ]; then
|
||||
rm -rf $toolsdir/$mosesnewdir
|
||||
fi
|
||||
fi
|
||||
#echo "Download Moses package"
|
||||
#wget $mosesurl
|
||||
fi
|
||||
if [ "$did_mosesscripts" = "0" ]; then
|
||||
if [ -f $toolsdir/$scriptspack ]; then
|
||||
rm $toolsdir/$scriptspack
|
||||
if [ -d $toolsdir/$scriptsdir ]; then
|
||||
rm -rf $toolsdir/$scriptsdir
|
||||
fi
|
||||
if [ -d $toolsdir/$scriptsnewdir ]; then
|
||||
rm -rf $toolsdir/$scriptsnewdir
|
||||
fi
|
||||
fi
|
||||
echo "Download Moses script package"
|
||||
wget $scriptsurl
|
||||
fi
|
||||
if [ "$did_scorer" = "0" ]; then
|
||||
if [ -f $toolsdir/$scorerpack ]; then
|
||||
rm $toolsdir/$scorerpack
|
||||
fi
|
||||
echo "Download scorer package"
|
||||
wget $scorerurl
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ -f $mosesdir/create.moses.log ]; then
|
||||
. $mosesdir/create.moses.log
|
||||
fi
|
||||
if [ "$did_irstlm" != "1" ]; then
|
||||
echo "****************************************** IRSTLM ..."
|
||||
if [ -f $toolsdir/$irstlmpack ]; then
|
||||
tar -xzvf $toolsdir/$irstlmpack
|
||||
if [ -d $toolsdir/$irstlmdir ]; then
|
||||
mv -f $toolsdir/$irstlmdir $toolsdir/$irstlmnewdir
|
||||
fi
|
||||
else
|
||||
wget $irstlmurl
|
||||
tar -xzvf $irstlmpack
|
||||
if [ -d $toolsdir/$irstlmdir ]; then
|
||||
mv -f $toolsdir/$irstlmdir $toolsdir/$irstlmnewdir
|
||||
fi
|
||||
fi
|
||||
if [ -d $toolsdir/$irstlmnewdir ]; then
|
||||
cd $toolsdir/$irstlmnewdir
|
||||
#./regenerate-makefiles.sh
|
||||
./configure --prefix=$toolsdir/$irstlmnewdir
|
||||
make
|
||||
make install
|
||||
fi
|
||||
MachType=`uname -m`
|
||||
if [ ! -f $toolsdir/$irstlmnewdir/bin/$MachType/quantize-lm ]; then
|
||||
echo "************************ IRSTLM not correctly installed. Script will now exit."
|
||||
sed -ie 's/^did_irstlm=.*$/did_irstlm=0/g' $mosesdir/create.moses.log
|
||||
exit 0
|
||||
else
|
||||
echo "************************ IRSTLM correctly installed."
|
||||
sed -ie 's/^did_irstlm=.*$/did_irstlm=1/g' $mosesdir/create.moses.log
|
||||
export PATH=$toolsdir/$irstlmnewdir/bin/$MachType:$toolsdir/$irstlmnewdir/bin:$PATH
|
||||
if [ "$did_moses" = "1" ]; then
|
||||
echo "Even though Moses was already correctly installed, it needs to be reinstalled after having recompiled IRSTLM."
|
||||
sed -ie 's/^did_moses=.*$/did_moses=0/g' $mosesdir/create.moses.log
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "************************ IRSTLM already correctly installed. Reusing it."
|
||||
export PATH=$toolsdir/$irstlmnewdir/bin/$MachType:$toolsdir/$irstlmnewdir/bin:$PATH
|
||||
fi
|
||||
|
||||
cd $toolsdir
|
||||
. $mosesdir/create.moses.log
|
||||
if [ "$did_randlm" != "1" ]; then
|
||||
echo "****************************************** RandLM ..."
|
||||
cd $toolsdir
|
||||
if [ -f $toolsdir/$randlmpack ]; then
|
||||
tar -xzvf $randlmpack
|
||||
else
|
||||
wget $randlmurl
|
||||
tar -xzvf $randlmpack
|
||||
fi
|
||||
if [ -d $toolsdir/$randlmdir/src ]; then
|
||||
sed '28i\#include <cstdio>' $toolsdir/$randlmdir/src/RandLMUtils.h > $toolsdir/$randlmdir/src/RandLMUtils.hr
|
||||
mv $toolsdir/$randlmdir/src/RandLMUtils.hr $toolsdir/$randlmdir/src/RandLMUtils.h
|
||||
cd $toolsdir/$randlmdir/src
|
||||
make all
|
||||
fi
|
||||
if [ ! -f $toolsdir/$randlmdir/bin/buildlm ]; then
|
||||
echo "************************ RandLM not correctly installed. Script will now exit."
|
||||
sed -ie 's/^did_randlm=.*$/did_randlm=0/g' $mosesdir/create.moses.log
|
||||
exit 0
|
||||
else
|
||||
echo "************************ RandLM correctly installed."
|
||||
sed -ie 's/^did_randlm=.*$/did_randlm=1/g' $mosesdir/create.moses.log
|
||||
export PATH=$toolsdir/$randlmdir/bin:$PATH
|
||||
if [ "$did_moses" = "1" ]; then
|
||||
echo "Even though Moses was already correctly installed, it needs to be reinstalled after having recompiled RandLM."
|
||||
sed -ie 's/^did_moses=.*$/did_moses=0/g' $mosesdir/create.moses.log
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "************************ RandLM already correctly installed. Reusing it."
|
||||
export PATH=$toolsdir/$randlmdir/bin:$PATH
|
||||
fi
|
||||
|
||||
cd $toolsdir
|
||||
. $mosesdir/create.moses.log
|
||||
|
||||
if [ "$did_mgiza" != "1" ]; then
|
||||
echo "****************************************** MGIZA ..."
|
||||
cd $toolsdir
|
||||
if [ -f $toolsdir/$mgizapack ]; then
|
||||
tar -xvzf $toolsdir/$mgizapack
|
||||
else
|
||||
wget $mgizaurl
|
||||
tar -xvzf $toolsdir/$mgizapack
|
||||
fi
|
||||
if [ -d $toolsdir/$mgizadir ]; then
|
||||
mv $toolsdir/$mgizadir $toolsdir/$mgizanewdir
|
||||
cd $toolsdir/$mgizanewdir
|
||||
./configure --prefix=$toolsdir/$mgizanewdir
|
||||
make
|
||||
make install
|
||||
fi
|
||||
if [ ! -f $toolsdir/$mgizanewdir/bin/symal ]; then
|
||||
echo "************************ MGIZA not correctly installed. Script will now exit."
|
||||
sed -ie 's/^did_mgiza=.*$/did_mgiza=0/g' $mosesdir/create.moses.log
|
||||
exit 0
|
||||
else
|
||||
echo "************************ MGIZA correctly installed."
|
||||
sed -ie 's/^did_mgiza=.*$/did_mgiza=1/g' $mosesdir/create.moses.log
|
||||
|
||||
# the train-model.perl script, as it is used by these scripts (which enable you to access otherwise hidden parameters), insists on using giza-pp; therefore, rename the
|
||||
# MGIZA executables so that they have the names that this script requires; another solution is probably possible, but no time to test it now
|
||||
cp $toolsdir/$mgizanewdir/bin/mgiza $toolsdir/$mgizanewdir/bin/GIZA++
|
||||
cp $toolsdir/$mgizanewdir/bin/snt2cooc $toolsdir/$mgizanewdir/bin/snt2cooc.out
|
||||
|
||||
export PATH=$toolsdir/$mgizanewdir/bin:$toolsdir/$mgizanewdir/scripts:$PATH
|
||||
fi
|
||||
else
|
||||
echo "************************ MGIZA already correctly installed. Reusing it."
|
||||
export PATH=$toolsdir/$mgizanewdir/bin:$toolsdir/$mgizanewdir/scripts:$PATH
|
||||
fi
|
||||
|
||||
if [ "$did_moses" != "1" ]; then
|
||||
echo "****************************************** Moses ..."
|
||||
cd $toolsdir
|
||||
if [ -f $toolsdir/$mosespack ]; then
|
||||
tar -xvzf $toolsdir/$mosespack
|
||||
chmod -R +rwx $toolsdir/$mosesnewdir
|
||||
else
|
||||
wget $mosesurl
|
||||
tar -xvzf $toolsdir/$mosespack
|
||||
chmod -R +rwx $toolsdir/$mosesnewdir
|
||||
fi
|
||||
|
||||
export mosesdir
|
||||
|
||||
if [ -d $toolsdir/$mosesnewdir ]; then
|
||||
cd $toolsdir/$mosesnewdir
|
||||
./regenerate-makefiles.sh
|
||||
./configure --with-irstlm=$toolsdir/$irstlmnewdir --with-randlm=$toolsdir/$randlmnewdir
|
||||
|
||||
make -j $mosesnumprocessors
|
||||
cp $toolsdir/$mosesnewdir/$scriptsdir $toolsdir/$mosesnewdir/$scriptsnewdir
|
||||
cd $toolsdir/$mosesnewdir/scripts
|
||||
sed -e 's#TARGETDIR=\/home\/pkoehn\/statmt\/bin#TARGETDIR=toolsdir/mosesnewdir#g' -e 's#BINDIR=\/home\/pkoehn\/statmt\/bin#BINDIR=toolsdir/mgizanewdir/bin#g' -e "s#toolsdir#$toolsdir#g" -e "s#mgizanewdir#$mgizanewdir#g" -e "s#mosesnewdir#$mosesnewdir#g" $toolsdir/$mosesnewdir/scripts/Makefile > $toolsdir/$mosesnewdir/scripts/Makefile.new
|
||||
mv $toolsdir/$mosesnewdir/scripts/Makefile.new $toolsdir/$mosesnewdir/scripts/Makefile
|
||||
make release
|
||||
if [ -d $toolsdir/$mosesnewdir/scripts?* ]; then
|
||||
rm -rf $toolsdir/$mosesnewdir/scripts
|
||||
fi
|
||||
fi
|
||||
if [ ! -f $toolsdir/$mosesnewdir/moses-cmd/src/moses ]; then
|
||||
echo "************************ Moses not correctly installed. Script will now exit."
|
||||
sed -ie 's/^did_moses=.*$/did_moses=0/g' $mosesdir/create.moses.log
|
||||
exit 0
|
||||
else
|
||||
echo "************************ Moses correctly installed."
|
||||
sed -ie 's/^did_moses=.*$/did_moses=1/g' $mosesdir/create.moses.log
|
||||
export SCRIPTS_ROOTDIR=$toolsdir/$mosesnewdir/script*
|
||||
fi
|
||||
else
|
||||
echo "************************ Moses already correctly installed. Reusing it."
|
||||
export SCRIPTS_ROOTDIR=$toolsdir/$mosesnewdir/script*
|
||||
fi
|
||||
|
||||
if [ "$did_mosesscripts" != "1" ]; then
|
||||
echo "****************************************** Moses scripts ..."
|
||||
. $mosesdir/create.moses.log
|
||||
cd $toolsdir
|
||||
if [ -f $toolsdir/$scriptspack ]; then
|
||||
tar -xzvf $toolsdir/$scriptspack
|
||||
else
|
||||
wget $scriptsurl
|
||||
tar -xvzf $toolsdir/$scriptspack
|
||||
fi
|
||||
if [ ! -f $toolsdir/$scriptsdir/tokenizer.perl ]; then
|
||||
echo "************************ Moses scripts not correctly copied. Script will now exit."
|
||||
sed -ie 's/^did_mosesscripts=.*$/did_mosesscripts=0/g' $mosesdir/create.moses.log
|
||||
exit 0
|
||||
else
|
||||
echo "************************ Moses scripts correctly copied."
|
||||
sed -ie 's/^did_mosesscripts=.*$/did_mosesscripts=1/g' $mosesdir/create.moses.log
|
||||
fi
|
||||
else
|
||||
echo "************************ Moses scripts already correctly installed. Reusing it."
|
||||
fi
|
||||
|
||||
if [ "$did_newscripts" != "1" ]; then
|
||||
echo "****************************************** New and modified scripts and demo files ..."
|
||||
SAVEIFS=$IFS
|
||||
IFS=$(echo -en "\n\b")
|
||||
cd $prworkdir
|
||||
if [ -d $prworkdir/modified-scripts ]; then
|
||||
echo "***************** Copy nonbreaking_prefix.pt ..."
|
||||
cp -f $prworkdir/modified-scripts/nonbreaking_prefix.pt $toolsdir/scripts/nonbreaking_prefixes
|
||||
chmod +x $toolsdir/scripts/nonbreaking_prefixes/nonbreaking_prefix.pt
|
||||
echo "***************** Copy mert-moses-new-modif.pl ..."
|
||||
cp -f $prworkdir/modified-scripts/mert-moses-new-modif.pl $toolsdir/modified-scripts/mert-moses-new-modif.pl
|
||||
chmod +x $toolsdir/modified-scripts/mert-moses-new-modif.pl
|
||||
if [ -f $toolsdir/scripts/nonbreaking_prefixes/nonbreaking_prefix.pt -a -f $toolsdir/modified-scripts/mert-moses-new-modif.pl ]; then
|
||||
sed -ie 's/^did_newscripts=.*$/did_newscripts=1/g' $mosesdir/create.moses.log
|
||||
else
|
||||
sed -ie 's/^did_newscripts=.*$/did_newscripts=0/g' $mosesdir/create.moses.log
|
||||
echo "Some new/modified scripts could not be copied. Exiting ..."
|
||||
IFS=$SAVEIFS
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
sed -ie 's/^did_newscripts=.*$/did_newscripts=0/g' $mosesdir/create.moses.log
|
||||
echo "The structure of Moses for Mere Mortals was changed. Please restore the initial structure so that the installation can proceed. New and modified Moses scripts cannot be installed. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
IFS=$SAVEIFS
|
||||
|
||||
if [ -d ../data-files/corpora_for_training ]; then
|
||||
echo "***************** Copy corpora_for_training ..."
|
||||
cp ../data-files/corpora_for_training/* $mosesdir/corpora_for_training
|
||||
if [ -f $mosesdir/corpora_for_training/300000.en ]; then
|
||||
sed -ie 's/^did_newscripts=.*$/did_newscripts=1/g' $mosesdir/create.moses.log
|
||||
else
|
||||
sed -ie 's/^did_newscripts=.*$/did_newscripts=0/g' $mosesdir/create.moses.log
|
||||
echo "Some corpora files needed for the demo of this script could not be copied. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
sed -ie 's/^did_newscripts=.*$/did_newscripts=0/g' $mosesdir/create.moses.log
|
||||
echo " The structure of Moses for Mere Mortals was changed. Corpora for training cannot be installed. Please restore the initial structure so that the installation can proceed. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -d ../data-files/translation_input ]; then
|
||||
cp ../data-files/translation_input/* $mosesdir/translation_input
|
||||
if [ -f $mosesdir/translation_input/100.pt ]; then
|
||||
sed -ie 's/^did_newscripts=.*$/did_newscripts=1/g' $mosesdir/create.moses.log
|
||||
else
|
||||
sed -ie 's/^did_newscripts=.*$/did_newscripts=0/g' $mosesdir/create.moses.log
|
||||
echo "A demo file needed for translation (100.pt) could not be copied. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo " The structure of Moses for Mere Mortals was changed. Please restore the initial structure so that the installation can proceed. Exiting ..."
|
||||
sed -ie 's/^did_newscripts=.*$/did_newscripts=0/g' $mosesdir/create.moses.log
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -d ../data-files/translation_reference ]; then
|
||||
cp ../data-files/translation_reference/* $mosesdir/translation_reference
|
||||
if [ -f $mosesdir/translation_reference/100.en.ref ]; then
|
||||
sed -ie 's/^did_newscripts=.*$/did_newscripts=1/g' $mosesdir/create.moses.log
|
||||
else
|
||||
sed -ie 's/^did_newscripts=.*$/did_newscripts=0/g' $mosesdir/create.moses.log
|
||||
echo "A demo file needed for translation (100.en) could not be copied. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo " The structure of Moses for Mere Mortals was changed. Please restore the initial structure so that the installation can proceed. Exiting ..."
|
||||
sed -ie 's/^did_newscripts=.*$/did_newscripts=0/g' $mosesdir/create.moses.log
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo "************************ Modified scripts and demo files already correctly installed. Reusing them."
|
||||
fi
|
||||
|
||||
if [ "$did_scorer" != "1" ]; then
|
||||
echo "****************************************** Scorer ..."
|
||||
if [ ! -f $toolsdir/$scorerpack ]; then
|
||||
cd $toolsdir
|
||||
wget $scorerurl
|
||||
if [ ! -f $toolsdir/$scorerpack ]; then
|
||||
echo "************************ Scorer not correctly copied. Script will now exit."
|
||||
sed -ie 's/^did_scorer=.*$/did_scorer=0/g' $mosesdir/create.moses.log
|
||||
exit 0
|
||||
else
|
||||
chmod +x $toolsdir/$scorerpack
|
||||
echo "************************ Scorer correctly copied."
|
||||
sed -ie 's/^did_scorer=.*$/did_scorer=1/g' $mosesdir/create.moses.log
|
||||
fi
|
||||
else
|
||||
echo "************************ Scorer correctly copied."
|
||||
sed -ie 's/^did_scorer=.*$/did_scorer=1/g' $mosesdir/create.moses.log
|
||||
fi
|
||||
else
|
||||
echo "************************ Scorer already correctly installed. Reusing it."
|
||||
fi
|
||||
|
||||
|
||||
cd $toolsdir
|
||||
if [ -f $mosesdir/create.moses.loge ]; then
|
||||
rm $mosesdir/create.moses.loge
|
||||
fi
|
||||
|
||||
if [ "$removedownloadedpackges" = "1" ]; then
|
||||
if [ -f $toolsdir/$irstlmpack ]; then
|
||||
rm $toolsdir/$irstlmpack
|
||||
fi
|
||||
if [ -f $toolsdir/$irstlmdir ]; then
|
||||
rm $toolsdir/$irstlmdir
|
||||
fi
|
||||
if [ -f $toolsdir/$randlmpack ]; then
|
||||
rm $toolsdir/$randlmpack
|
||||
fi
|
||||
if [ -f $toolsdir/$mgizapack ]; then
|
||||
rm $toolsdir/$mgizapack
|
||||
fi
|
||||
if [ -f $toolsdir/$mosespack ]; then
|
||||
rm $toolsdir/$mosespack
|
||||
fi
|
||||
if [ -f $toolsdir/$mosessoftdir ]; then
|
||||
rm $toolsdir/$mosessoftdir
|
||||
fi
|
||||
if [ -f $toolsdir/$scriptspack ]; then
|
||||
rm $toolsdir/$scriptspack
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
echo "!!! Successful end of Moses installation. !!!"
|
||||
echo "Moses base directory located in $mosesdir"
|
||||
|
||||
#*************************************************************************************************
|
||||
# Changes in versions 1.36, 1.37
|
||||
#*************************************************************************************************
|
||||
#Changed the data files (containing namely the demo corpus) to another location
|
||||
#*************************************************************************************************
|
||||
# Changes in version 1.35
|
||||
#*************************************************************************************************
|
||||
# Uses new Moses decoder (published in August 13, 2010 and updated in August 14, 2010)
|
||||
# Updates package dependencies
|
||||
#Suppresses giza-pp installation (which is not used by the train script)
|
||||
# Works in Ubuntu 10.04 LTS (and, if you adapt the package dependencies, with Ubuntu 9.10 and 9.04)
|
@ -1,137 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# make-test-files-0.14
|
||||
# copyright 2010, João L. A. C. Rosas
|
||||
# licenced under the GPL licence, version 3
|
||||
# date: 23/08/2010
|
||||
# Special thanks to Hilário Leal Fontes and Maria José Machado, who helped to test the script and made very helpful suggestions
|
||||
|
||||
# ***Purpose***: given 2 strictly aligned files, one in the source language and another in the target language, this script creates a backup of them and cuts each of them in 2 parts: one that will be used for training and another for testing the training. The initial files are divided into X sectors (defined by the user in the settings of this script) and the script extracts Y pseudorandom segments from each sector (the value Y is also defined by the user). This script can be used to create training test files that attempt to cover the whole universe of the sampling space and which simultaneously sample pseudorandomly each of those sectors Y times in an attempt to get a test file that is more representative of that universe than a list of X*Y consecutive segments would be. The files used for training will have those segments erased. The initial corpus will be preserved (the files that will be used for corpus training are new files created by this script).
|
||||
|
||||
###########################################################################################################################################################
|
||||
#THIS SCRIPT ASSUMES THAT A IRSTLM AND RANDLM ENABLED MOSES HAS ALREADY BEEN INSTALLED WITH create-moses-irstlm-randlm IN $mosesdir (BY DEFAULT $HOME/moses-irstlm-randlm; CHANGE THIS VARIABLE ACCORDING TO YOUR NEEDS)
|
||||
# IT ALSO ASSUMES THAT THE PACKAGES UPON WHICH IT DEPENDS, INDICATED IN the create-moses-irstlm-randlm script, HAVE BEEN INSTALLED
|
||||
# This script should be used after the execution of create-moses-irstlm-randlm and before the execution of train-moses-irstlm-randlm (it creates the corpus and the test files that will be used by this latter script)
|
||||
###########################################################################################################################################################
|
||||
|
||||
##########################################################################################################################################################
|
||||
# The values of the variables that follow should be filled according to your needs: # ##########################################################################################################################################################
|
||||
#Base path of Moses installation
|
||||
mosesdir=$HOME/moses-irstlm-randlm
|
||||
#Source language abbreviation
|
||||
lang1=pt
|
||||
#Target language abbreviation
|
||||
lang2=en
|
||||
#Number of sectors in which each input file will be cut
|
||||
totalnumsectors=100
|
||||
#Number of segments pseudorandomly searched in each sector
|
||||
numsegs=10
|
||||
#Name of the source language file used for creating one of the test files (!!! omit the path; the name should not include spaces !!!)
|
||||
basefilename=200000
|
||||
##########################################################################################################################################################
|
||||
# DO NOT CHANGE THE LINES THAT FOLLOW ... unless you know what you are doing! #
|
||||
##########################################################################################################################################################
|
||||
startdate=`date +day:%d/%m/%y-time:%H:%M:%S`
|
||||
#Function to get a random positive number with up to 10 digits between highest ($1) and lowest ($2)
|
||||
randompos(){
|
||||
num=$(( ( ($RANDOM & 3)<<30 | $RANDOM<<15 | $RANDOM ) - 0x80000000 ))
|
||||
if [ $num -lt 0 ] ; then
|
||||
# $1 = highest; $2 = lowest
|
||||
newnum=$[ `expr 0 - $num` % ( $[ $1 - $2 ] + 1 ) + $2 ]
|
||||
else
|
||||
newnum=$[ $num % ( $[ $1 - $2 ] + 1 ) + $2 ]
|
||||
fi
|
||||
echo $newnum
|
||||
}
|
||||
|
||||
exchange()
|
||||
{
|
||||
local temp=${numsegarray[$1]}
|
||||
numsegarray[$1]=${numsegarray[$2]}
|
||||
numsegarray[$2]=$temp
|
||||
return
|
||||
}
|
||||
|
||||
#This function was published in jeronimo's blog (http://www.roth.lu/serendipity/index.php?/archives/31-Bash-Arrays-and-search-function.html)
|
||||
# Function to find out whether something exists in a bash array or not
|
||||
bash__is_in_array () {
|
||||
haystack=( "$@" )
|
||||
haystack_size=( "${#haystack[@]}" )
|
||||
needle=${haystack[$((${haystack_size}-1))]}
|
||||
for ((i=0;i<$(($haystack_size-1));i++)); do
|
||||
h=${haystack[${i}]};
|
||||
[ $h = $needle ] && return 42
|
||||
done
|
||||
}
|
||||
|
||||
echo "************* Do some preparatory work (it can take a long time to read the input files, if they are large)"
|
||||
#Directory where the source and target language files used for creating one of the test files is located
|
||||
basefiledir=$mosesdir/corpora_for_training
|
||||
#Directory where will be placed the test files that will be created
|
||||
testdir=$mosesdir/corpora_for_training
|
||||
|
||||
#Eliminate some control characters that can cause Moses training errors
|
||||
tr '\a\b\f\r\v|' ' /' < $basefiledir/$basefilename.$lang1 > $testdir/$basefilename.for_train.$lang1
|
||||
tr '\a\b\f\r\v|' ' /' < $basefiledir/$basefilename.$lang2 > $testdir/$basefilename.for_train.$lang2
|
||||
|
||||
#Determine the number of lines of each file and check that they are equal
|
||||
numlines_s=`wc -l "$basefiledir/$basefilename.$lang1" | awk '{print $1'}`
|
||||
numlines_t=`wc -l "$basefiledir/$basefilename.$lang2" | awk '{print $1'}`
|
||||
if [ "$numlines_s" != "$numlines_t" ]; then
|
||||
echo "Source and target files have a different number of segments (source = $numlines_s and target = $numlines_t). If you verify manually that they do have the same number of segments, then Bash is interpreting at least one of the characters of one of the files as something it isn't. If that is the case, you will have to isolate the line(s) that is (are) causing problems and to substitute the character in question by some other character. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#Calculate number of lines per sector
|
||||
numlinespersector=$(echo "scale=0; $numlines_s/$totalnumsectors" | bc)
|
||||
#Calculate total number of segments to extract
|
||||
totsegstoextract=$(echo "scale=0; $totalnumsectors*$numsegs" | bc)
|
||||
|
||||
echo "************* $totalnumsectors sectors to extract. This can take some time ..."
|
||||
#Create temporary files
|
||||
echo > /tmp/$basefilename.for_test.$lang1
|
||||
echo > /tmp/$basefilename.for_test.$lang2
|
||||
echo "extract segments for testing from:"
|
||||
#Total number of segments extracted so far for the training test file
|
||||
totsegsextracted=0
|
||||
if (( $(echo "scale=0; $totsegstoextract-$numlines_s" | bc) < 0 )); then
|
||||
for (( sector=1; sector<=$totalnumsectors; sector++ )) ; do
|
||||
echo "sector $sector"
|
||||
floor=$(echo "scale=0; $numlinespersector*$sector-$numlinespersector+1" | bc)
|
||||
ceiling=$(echo "scale=0; $numlinespersector*$sector" | bc)
|
||||
sectornumsegsextracted=0
|
||||
number=-1
|
||||
while (( $sectornumsegsextracted < $numsegs )) ; do
|
||||
number=`randompos $ceiling $floor`
|
||||
bash__is_in_array "${numsegarray[@]}" $number
|
||||
if [ $? -ne 42 ]; then
|
||||
let "sectornumsegsextracted += 1"
|
||||
let "totsegsextracted += 1"
|
||||
awk "NR==$number{print;exit}" $testdir/$basefilename.for_train.$lang1 >> /tmp/$basefilename.for_test.$lang1
|
||||
numsegarray[$totsegsextracted]=$number
|
||||
f+=${numsegarray[$totsegsextracted]}
|
||||
f+="d;"
|
||||
awk "NR==$number{print;exit}" $testdir/$basefilename.for_train.$lang2 >> /tmp/$basefilename.for_test.$lang2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
echo "************* erase segments used for testing in training files"
|
||||
f=`echo "$f" | sed 's#\;#\n#g' | sort -nr `
|
||||
f=`echo "$f" | sed 's#\n#;#g'`
|
||||
f=${f%;;*}
|
||||
sed "$f" $testdir/$basefilename.for_train.$lang1 > /tmp/$basefilename.for_train.$lang1.temp
|
||||
sed "$f" $testdir/$basefilename.for_train.$lang2 > /tmp/$basefilename.for_train.$lang2.temp
|
||||
echo "************* final cleaning operations"
|
||||
sed '1d' /tmp/$basefilename.for_test.$lang1 > $testdir/$basefilename.for_test.$lang1
|
||||
sed '1d' /tmp/$basefilename.for_test.$lang2 > $testdir/$basefilename.for_test.$lang2
|
||||
mv -f /tmp/$basefilename.for_train.$lang1.temp $testdir/$basefilename.for_train.$lang1
|
||||
mv -f /tmp/$basefilename.for_train.$lang2.temp $testdir/$basefilename.for_train.$lang2
|
||||
else
|
||||
echo "The files you want to sample have less lines than the number of sectors times the number of segments that you want to extract per sector. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
echo "starting date: $startdate"
|
||||
echo "ending date : `date +day:%d/%m/%y-time:%H:%M:%S`"
|
||||
echo "!!! Test files created in $testdir/$basefilename.for_test.$lang1 and $testdir/$basefilename.for_test.$lang2. Corpus training files (where the segments selected for training were erased) created in $testdir/$basefilename.for_train.$lang1 and $testdir/$basefilename.for_train.$lang2 !!!"
|
||||
|
||||
|
@ -1,2 +0,0 @@
|
||||
1) The mert-moses-new-modif.pl is a file that contains a slight modification of the mert-moses-new.pl script so that tuning can be stopped after a set amount of runs.
|
||||
2) The nonbreaking_prefix.pt script is a file whose author is Hilário Leal Fontes.
|
@ -1,209 +0,0 @@
|
||||
#File adapted for PT by H. Leal Fontes from the EN & DE versions published with moses-2009-04-13. Last update: 10.11.2009.
|
||||
#Anything in this file, followed by a period (and an upper-case word), does NOT indicate an end-of-sentence marker.
|
||||
#Special cases are included for prefixes that ONLY appear before 0-9 numbers.
|
||||
|
||||
#any single upper case letter followed by a period is not a sentence ender (excluding I occasionally, but we leave it in)
|
||||
#usually upper case letters are initials in a name
|
||||
A
|
||||
B
|
||||
C
|
||||
D
|
||||
E
|
||||
F
|
||||
G
|
||||
H
|
||||
I
|
||||
J
|
||||
K
|
||||
L
|
||||
M
|
||||
N
|
||||
O
|
||||
P
|
||||
Q
|
||||
R
|
||||
S
|
||||
T
|
||||
U
|
||||
V
|
||||
W
|
||||
X
|
||||
Y
|
||||
Z
|
||||
a
|
||||
b
|
||||
c
|
||||
d
|
||||
e
|
||||
f
|
||||
g
|
||||
h
|
||||
i
|
||||
j
|
||||
k
|
||||
l
|
||||
m
|
||||
n
|
||||
o
|
||||
p
|
||||
q
|
||||
r
|
||||
s
|
||||
t
|
||||
u
|
||||
v
|
||||
w
|
||||
x
|
||||
y
|
||||
z
|
||||
|
||||
|
||||
#Roman Numerals. A dot after one of these is not a sentence break in Portuguese.
|
||||
I
|
||||
II
|
||||
III
|
||||
IV
|
||||
V
|
||||
VI
|
||||
VII
|
||||
VIII
|
||||
IX
|
||||
X
|
||||
XI
|
||||
XII
|
||||
XIII
|
||||
XIV
|
||||
XV
|
||||
XVI
|
||||
XVII
|
||||
XVIII
|
||||
XIX
|
||||
XX
|
||||
i
|
||||
ii
|
||||
iii
|
||||
iv
|
||||
v
|
||||
vi
|
||||
vii
|
||||
viii
|
||||
ix
|
||||
x
|
||||
xi
|
||||
xii
|
||||
xiii
|
||||
xiv
|
||||
xv
|
||||
xvi
|
||||
xvii
|
||||
xviii
|
||||
xix
|
||||
xx
|
||||
|
||||
#List of titles. These are often followed by upper-case names, but do not indicate sentence breaks
|
||||
Adj
|
||||
Adm
|
||||
Adv
|
||||
Art
|
||||
Ca
|
||||
Capt
|
||||
Cmdr
|
||||
Col
|
||||
Comdr
|
||||
Con
|
||||
Corp
|
||||
Cpl
|
||||
DR
|
||||
DRA
|
||||
Dr
|
||||
Dra
|
||||
Dras
|
||||
Drs
|
||||
Eng
|
||||
Enga
|
||||
Engas
|
||||
Engos
|
||||
Ex
|
||||
Exo
|
||||
Exmo
|
||||
Fig
|
||||
Gen
|
||||
Hosp
|
||||
Insp
|
||||
Lda
|
||||
MM
|
||||
MR
|
||||
MRS
|
||||
MS
|
||||
Maj
|
||||
Mrs
|
||||
Ms
|
||||
Msgr
|
||||
Op
|
||||
Ord
|
||||
Pfc
|
||||
Ph
|
||||
Prof
|
||||
Pvt
|
||||
Rep
|
||||
Reps
|
||||
Res
|
||||
Rev
|
||||
Rt
|
||||
Sen
|
||||
Sens
|
||||
Sfc
|
||||
Sgt
|
||||
Sr
|
||||
Sra
|
||||
Sras
|
||||
Srs
|
||||
Sto
|
||||
Supt
|
||||
Surg
|
||||
adj
|
||||
adm
|
||||
adv
|
||||
art
|
||||
cit
|
||||
col
|
||||
con
|
||||
corp
|
||||
cpl
|
||||
dr
|
||||
dra
|
||||
dras
|
||||
drs
|
||||
eng
|
||||
enga
|
||||
engas
|
||||
engos
|
||||
ex
|
||||
exo
|
||||
exmo
|
||||
fig
|
||||
op
|
||||
prof
|
||||
sr
|
||||
sra
|
||||
sras
|
||||
srs
|
||||
sto
|
||||
|
||||
#misc - odd period-ending items that NEVER indicate breaks (p.m. does NOT fall into this category - it sometimes ends a sentence)
|
||||
v
|
||||
vs
|
||||
i.e
|
||||
rev
|
||||
e.g
|
||||
|
||||
#Numbers only. These should only induce breaks when followed by a numeric sequence
|
||||
# add NUMERIC_ONLY after the word for this function
|
||||
#This case is mostly for the english "No." which can either be a sentence of its own, or
|
||||
#if followed by a number, a non-breaking prefix
|
||||
No #NUMERIC_ONLY#
|
||||
Nos
|
||||
Art #NUMERIC_ONLY#
|
||||
Nr
|
||||
p #NUMERIC_ONLY#
|
||||
pp #NUMERIC_ONLY#
|
@ -1,509 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# score-0.85
|
||||
# copyright 2010, João L. A. C. Rosas
|
||||
# licenced under the GPL licence, version 3
|
||||
# date: 02/09/2010
|
||||
# Special thanks to Hilário Leal Fontes and Maria José Machado who made research about this script, sent me experimental results, helped to test it and made very helpful suggestions
|
||||
|
||||
# ***Purpose***: This script processes all the Moses translation files present in the $mosesdir/translation_files_for_tmx, if you want to prepare a translation to be used with a translation memory, or in the $mosesdir/translation_output directory, if you want to have a plain translation. For each Moses translation present there, it extracts from its name the names of the abbreviations of the source and target languages and of the scorebasename (which must not included the "." sign). With this information, it reconstructs the full name of the source file and reference translation file. For a set of source file, its Moses translation file and its reference (human-made) translation file, this script creates a report presenting, depending on the parameters set by the user, either 1) a score of the whole Moses translation or 2) a score of each segment of the Moses translation. In this latter case, each line of the file consists of the a) BLEU score and b) NIST score of the Moses translation ***of that segment***, c) the number of the segment in the source document, d) the source, e) reference and f) Moses translation segments, in that order. These 6 fields are separated by the "|" character. The lines are sorted by ascending order of BLEU score.
|
||||
|
||||
###########################################################################################################################################################
|
||||
#THIS SCRIPT ASSUMES THAT A IRSTLM AND RANDLM ENABLED MOSES HAS ALREADY BEEN INSTALLED WITH THE create script IN $mosesdir (BY DEFAULT $HOME/moses-irstlm-randlm), THAT A CORPUS HAS BEEN TRAINED WITH THE train script AND THAT A TRANSLATION HAS ALREADY BEEN MADE WITH THE translate script.
|
||||
# IT ALSO ASSUMES THAT THE PACKAGES UPON WHICH IT DEPENDS, INDICATED IN THE create script, HAVE BEEN INSTALLED
|
||||
###########################################################################################################################################################
|
||||
|
||||
##########################################################################################################################################################
|
||||
# The values of the variables that follow should be filled according to your needs: # ##########################################################################################################################################################
|
||||
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
# !!! THIS SCRIPT SHOULD NOT BE USED WITH DOCUMENTS TRANSLATED WITH THE translate script WITH ITS $translate_for_tmx PARAMETER SET TO 1 ***UNLESS*** the $othercleanings, $improvesegmentation and $ removeduplicates parameters of that script were all set to 0 and $minseglen was set to -1 (this processing changes the order of the segments and can also make the source document have a number of segments that is different from the number of segments of the reference translation, namely because it can delete some segments and/or add some new ones) !!!
|
||||
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
# !!! The names of the source and target reference translation files used for scoring should not include spaces !!!
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
# The source file name and the reference translation file MUST observe the following conventions:
|
||||
# Source file : <basename>.<abbreviation of source language> (ex: 100.en)
|
||||
# Reference translation file: <basename>.<abbreviation of target language>.ref (ex: 100.pt.ref)
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
#Base directory of your Moses installation (made with the create script)
|
||||
mosesdir=$HOME/moses-irstlm-randlm
|
||||
#Scores documents prepared for TMX translation memories. If this parameter is set to 1, the script will look for the documents $s and $m in the $mosesdir/translation_files_for_tmx directory; if not set to 1, it will look for the $s document in the mosesdir/translation_input directory and for the $m document in $mosesdir/translation_output; in both cases, it will look for the $r document in $mosesdir/translation_reference
|
||||
scoreTMXdocuments=0
|
||||
#This is an arbitrary commentary that you can use if you want to register something (a parameter used, whatever) in the name of the scorefile. Like this, you might not have to open several files before discovering the one you are really looking for (if you do many scores of the same document translated with different parameters); more useful while you are trying to discover the right combination of parameters for your specific situation; !!!Remember, however, that most Linux systems have a maximum file name length of 255 characters; if the name of the document to translate is already long, you might exceed that limit !!! Example of a note:"12-07-2010" (date of the batch score)
|
||||
batch_user_note="12-07-2010"
|
||||
#Create a report where each segment gets its own score; 0 = score the whole document; 1 = score each segment
|
||||
score_line_by_line=0
|
||||
#Remove moses translation segments that are equal to reference translation segments and whose BLEU score is zero (!!! Only active if score_line_by_line=1 !!!)
|
||||
remove_equal=1
|
||||
#Tokenize the source document and the reference and the Moses translation
|
||||
tokenize=1
|
||||
#Lowercase the source document and the reference and the Moses translation
|
||||
lowercase=1
|
||||
##########################################################################################################################################################
|
||||
# DO NOT CHANGE THE LINES THAT FOLLOW ... unless you know what you are doing! #
|
||||
##########################################################################################################################################################
|
||||
#Directory where Moses translation tools are located
|
||||
toolsdir=$mosesdir/tools
|
||||
if [ "$scoreTMXdocuments" = "1" ]; then
|
||||
sourcelanguagedir=$mosesdir/translation_files_for_tmx
|
||||
mosestranslationdir=$mosesdir/translation_files_for_tmx
|
||||
else
|
||||
sourcelanguagedir=$mosesdir/translation_input
|
||||
mosestranslationdir=$mosesdir/translation_output
|
||||
fi
|
||||
reftranslationdir=$mosesdir/translation_reference
|
||||
|
||||
#Directory where the output of the present script, the translation scoring document, will be created
|
||||
scoredir=$mosesdir/translation_scoring
|
||||
|
||||
# Create the input directories, if they do not yet exist; later steps will confirm that the input files do not yet exist (this saves time to the user, who will not have to also create these directories)
|
||||
if [ ! -d $sourcelanguagedir ] ; then mkdir -p $sourcelanguagedir ; fi
|
||||
if [ ! -d $reftranslationdir ] ; then mkdir -p $reftranslationdir ; fi
|
||||
if [ ! -d $mosestranslationdir ] ; then mkdir -p $mosestranslationdir ; fi
|
||||
if [ ! -d $scoredir ] ; then mkdir -p $scoredir ; fi
|
||||
|
||||
# Define functions
|
||||
remove_garbage() {
|
||||
if [ -f $scoredir/$s ]; then
|
||||
rm $scoredir/$s
|
||||
fi
|
||||
if [ -f $scoredir/$r ]; then
|
||||
rm $scoredir/$r
|
||||
fi
|
||||
if [ -f $scoredir/$m ]; then
|
||||
rm $scoredir/$m
|
||||
fi
|
||||
if [ -f $scoredir/$scorebasename-src.$lang1.sgm ]; then
|
||||
rm $scoredir/$scorebasename-src.$lang1.sgm
|
||||
fi
|
||||
if [ -f $scoredir/$scorebasename-ref.$lang2.sgm ]; then
|
||||
rm $scoredir/$scorebasename-ref.$lang2.sgm
|
||||
fi
|
||||
if [ -f $scoredir/$scorebasename.moses.sgm ]; then
|
||||
rm $scoredir/$scorebasename.moses.sgm
|
||||
fi
|
||||
}
|
||||
log_wrong_file() {
|
||||
if [ ! -f $scoredir/$tmp ]; then
|
||||
echo "LIST OF NOT SCORED FILES (in the $mosestranslationdir directory):" > $scoredir/$tmp
|
||||
echo "==============================================================================================" >> $scoredir/$tmp
|
||||
echo "" >> $scoredir/$tmp
|
||||
echo "==============================================================================================" >> $scoredir/$tmp
|
||||
fi
|
||||
echo -e "***$filename*** file:" >> $scoredir/$tmp
|
||||
echo "----------------------------------------------------------------------------------------------" >> $scoredir/$tmp
|
||||
echo -e "\t$error_msg" >> $scoredir/$tmp
|
||||
echo "==============================================================================================" >> $scoredir/$tmp
|
||||
}
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
SAVEIFS=$IFS
|
||||
IFS=$(echo -en "\n\b")
|
||||
tmp="!!!SCORES-NOT-DONE!!!"
|
||||
if [ -f $scoredir/$tmp ]; then
|
||||
rm $scoredir/$tmp
|
||||
fi
|
||||
|
||||
i=0
|
||||
for filetoscore in $mosestranslationdir/*; do
|
||||
if [ ! -d $filetoscore ]; then
|
||||
error_msg=""
|
||||
filename=${filetoscore##*/}
|
||||
tempbasename=${filename%.*}
|
||||
tempbasename1=${tempbasename%.*}
|
||||
scorebasename=${tempbasename1%.*}
|
||||
temp=${filename%.*}
|
||||
temp1=${temp%.*}
|
||||
lang1=${temp1##*.}
|
||||
lang2=${temp##*.}
|
||||
s=$scorebasename.$lang1
|
||||
m=$filename
|
||||
r=$scorebasename.$lang2.ref
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
#Define report name
|
||||
if [ "$lang1" = "$filename" -a "$lang2" = "$filename" ]; then
|
||||
lang1t=""
|
||||
lang2t=""
|
||||
else
|
||||
lang1t=$lang1
|
||||
lang2t=$lang2
|
||||
fi
|
||||
if [ "$score_line_by_line" = "1" ]; then
|
||||
scorefile=$scorebasename.$batch_user_note.$lang1t-$lang2t.F-$scoreTMXdocuments-R-$remove_equal-T-$tokenize.L-$lowercase.line-by-line
|
||||
else
|
||||
scorefile=$scorebasename-$batch_user_note-$lang1t-$lang2t.F-$scoreTMXdocuments-R-$remove_equal-T-$tokenize.L-$lowercase.whole-doc
|
||||
fi
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
scorefile_name_len=${#scorefile}
|
||||
if [ "${filetoscore##*.}" = "moses" ]; then
|
||||
echo "--------------------------------------------------------------------"
|
||||
echo "MOSES TRANSLATION: $filename (in the $mosestranslationdir directory)"
|
||||
let i=$i+1
|
||||
if [ "$scorefile_name_len" -gt "229" -a "$score_line_by_line" != "1" ]; then
|
||||
echo "==============================================================================================" >> $scoredir/$tmp
|
||||
error_msg="The translated file name and/or the \$batch_user_note parameter would result in a scorefile name that exceeds the maximal limit of 255 characters. Please try to use translation files and user notes that do not lead to files names exceeding the maximal allowable length."
|
||||
echo -e "$error_msg Analysing now next Moses translation."
|
||||
log_wrong_file
|
||||
scorefile=$(echo $scorefile | cut -c1-229)
|
||||
continue
|
||||
fi
|
||||
if [ "$scorefile_name_len" -gt "242" -a "$score_line_by_line" = "1" ]; then
|
||||
error_msg="The translated file name and/or the \$batch_user_note parameter would result in a scorefile name that exceeds the maximal limit of 255 characters. Please try to use translation files and user notes that do not lead to files with names exceeding their maximal allowable length."
|
||||
echo -e "$error_msg Analysing now next Moses translation."
|
||||
log_wrong_file
|
||||
scorefile=$(echo $scorefile | cut -c1-242)
|
||||
continue
|
||||
fi
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
if [ "$lang1" = "$lang2" ]; then
|
||||
error_msg="You did not respect the Moses for Mere Mortals conventions for naming the source and or the reference files.\n\tSource file\t\t\t: <scorebasename>.<source language abbreviation> (ex: 100.pt)\n\tReference translation file\t: <scorebasename>.<target language abbreviation> (ex: 100.en.ref)\nPlease correct the name of the files and then run this script again."
|
||||
echo -e "$error_msg Analysing now next Moses translation."
|
||||
log_wrong_file
|
||||
continue
|
||||
fi
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
#Get number of segments for each input file (source, reference and Moses translation)
|
||||
#avoid wc error messages when the file does not exist
|
||||
exec 3> /dev/stderr 2> /dev/null
|
||||
lines_s=`wc -l "$sourcelanguagedir/$s" | awk '{print $1'}`
|
||||
if [ "$lines_s" ]; then
|
||||
echo "Source file : $lines_s lines"
|
||||
else
|
||||
echo "Source file : doesn't exist"
|
||||
fi
|
||||
lines=`wc -l "$mosestranslationdir/$m" | awk '{print $1'}`
|
||||
if [ "$lines" ]; then
|
||||
echo "Moses translation: $lines lines"
|
||||
else
|
||||
echo "Moses translation: doesn't exist"
|
||||
fi
|
||||
lines_r=`wc -l "$reftranslationdir/$r" | awk '{print $1'}`
|
||||
if [ "$lines_r" ]; then
|
||||
echo "Reference file : $lines_r lines"
|
||||
else
|
||||
echo "Reference file : doesn't exist"
|
||||
fi
|
||||
exec 2>&3
|
||||
|
||||
#Check that source, reference and Moses translation files have the same number of segments
|
||||
if [ "$lines_s" != "$lines_r" ]; then
|
||||
if [ "$lines_s" = "" ]; then
|
||||
lines_s=0
|
||||
fi
|
||||
if [ "$lines_r" = "" ]; then
|
||||
lines_r=0
|
||||
fi
|
||||
error_msg="Source and reference files do not have the same number of lines (source = $lines_s and reference = $lines_r lines) or one or both of them might not exist. If you verify manually that they do have the same number of segments, then wc (a Linux command) is interpreting at least one of the characters of one of the files as something it isn't. If that is the case, you will have to isolate the line(s) that is (are) causing problems and to substitute the character in question by some other character."
|
||||
echo "$error_msg Analysing now next Moses translation."
|
||||
log_wrong_file
|
||||
remove_garbage
|
||||
continue
|
||||
fi
|
||||
if [ "$lines" != "$lines_r" ]; then
|
||||
if [ "$lines" = "" ]; then
|
||||
lines=0
|
||||
fi
|
||||
if [ "$lines_r" = "" ]; then
|
||||
lines_r=0
|
||||
fi
|
||||
error_msg="Reference and moses translation files do not have the same number of lines (reference = $lines_r lines and moses translation = $lines) or one or both of them might not exist. If you verify manually that they do have the same number of segments, then wc (a Linux command) is interpreting at least one of the characters of one of the files as something it isn't. If that is the case, you will have to isolate the line(s) that is (are) causing problems and to substitute the character in question by some other character."
|
||||
echo "$error_msg Analysing now next Moses translation."
|
||||
log_wrong_file
|
||||
remove_garbage
|
||||
continue
|
||||
fi
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
#Check that $s, $r and $m exist
|
||||
if [ ! -f $sourcelanguagedir/$s ] ; then
|
||||
error_msg="The expected source language file ($sourcelanguagedir/$s) needed for scoring the Moses translation ($mosestranslationdir/$m) does not exist. Did you respect the file naming conventions described at the top of the score-0.85 script or did you use the wrong language pair for translating?"
|
||||
echo "$error_msg Analysing now next Moses translation."
|
||||
log_wrong_file
|
||||
continue
|
||||
else
|
||||
cp $sourcelanguagedir/$s $scoredir
|
||||
if [ "$tokenize" = "1" -a "$lowercase" = "1" ]; then
|
||||
$toolsdir/scripts/tokenizer.perl -l $lang1 < $scoredir/$s > $scoredir/$s.tok
|
||||
$toolsdir/scripts/lowercase.perl < $scoredir/$s.tok > $scoredir/$s
|
||||
rm -f $scoredir/$s.tok
|
||||
elif [ "$tokenize" = "1" ]; then
|
||||
$toolsdir/scripts/tokenizer.perl -l $lang1 < $scoredir/$s > $scoredir/$s.tok
|
||||
mv -f $scoredir/$s.tok $scoredir/$s
|
||||
elif [ "$lowercase" = "1" ]; then
|
||||
$toolsdir/scripts/lowercase.perl < $scoredir/$s > $scoredir/$s.lower
|
||||
mv -f $scoredir/$s.lower $scoredir/$s
|
||||
fi
|
||||
sed 's/\\$/\\ /g' < $scoredir/$s > $scoredir/$s.clean
|
||||
mv -f $scoredir/$s.clean $scoredir/$s
|
||||
fi
|
||||
if [ ! -f $reftranslationdir/$r ] ; then
|
||||
error_msg="The expected reference (human-made) file ($reftranslationdir/$r) needed for scoring the Moses translation ($mosestranslationdir/$m) does not exist."
|
||||
echo "$error_msg Analysing now next Moses translation. Did you respect the file naming conventions described at the top of the score-0.21 script or did you use the wrong language pair for translating?"
|
||||
log_wrong_file
|
||||
continue
|
||||
else
|
||||
cp $reftranslationdir/$r $scoredir
|
||||
if [ "$tokenize" = "1" -a "$lowercase" = "1" ]; then
|
||||
$toolsdir/scripts/tokenizer.perl -l $lang2 < $scoredir/$r > $scoredir/$r.tok
|
||||
$toolsdir/scripts/lowercase.perl < $scoredir/$r.tok > $scoredir/$r
|
||||
rm -f $scoredir/$r.tok
|
||||
elif [ "$tokenize" = "1" ]; then
|
||||
$toolsdir/scripts/tokenizer.perl -l $lang2 < $scoredir/$r > $scoredir/$r.tok
|
||||
mv -f $scoredir/$r.tok $scoredir/$r
|
||||
elif [ "$lowercase" = "1" ]; then
|
||||
$toolsdir/scripts/lowercase.perl < $scoredir/$r > $scoredir/$r.lower
|
||||
mv -f $scoredir/$r.lower $scoredir/$r
|
||||
fi
|
||||
sed 's/\\$/\\ /g' < $scoredir/$r > $scoredir/$r.clean
|
||||
mv -f $scoredir/$r.clean $scoredir/$r
|
||||
fi
|
||||
if [ ! -f $mosestranslationdir/$m ] ; then
|
||||
error_msg="The Moses translation file ($mosestranslationdir/$m) file does not exist. Did you respect the file naming conventions described at the top of the score-0.80 script?"
|
||||
echo "$error_msg Analysing now next Moses translation."
|
||||
log_wrong_file
|
||||
continue
|
||||
else
|
||||
cp $mosestranslationdir/$m $scoredir
|
||||
if [ "$tokenize" = "1" -a "$lowercase" = "1" ]; then
|
||||
$toolsdir/scripts/tokenizer.perl -l $lang2 < $scoredir/$m > $scoredir/$m.tok
|
||||
$toolsdir/scripts/lowercase.perl < $scoredir/$m.tok > $scoredir/$m
|
||||
rm -f $scoredir/$m.tok
|
||||
elif [ "$tokenize" = "1" ]; then
|
||||
$toolsdir/scripts/tokenizer.perl -l $lang2 < $scoredir/$m > $scoredir/$m.tok
|
||||
mv -f $scoredir/$m.tok $scoredir/$m
|
||||
elif [ "$lowercase" = "1" ]; then
|
||||
$toolsdir/scripts/lowercase.perl < $scoredir/$m > $scoredir/$m.lower
|
||||
mv -f $scoredir/$m.lower $scoredir/$m
|
||||
fi
|
||||
sed 's/\\$/\\ /g' < $scoredir/$m > $scoredir/$m.clean
|
||||
mv -f $scoredir/$m.clean $scoredir/$m
|
||||
fi
|
||||
|
||||
echo "===================================================================================" > $scoredir/temp
|
||||
echo "*** Script version ***: score-0.85" >> $scoredir/temp
|
||||
echo "===================================================================================" >> $scoredir/temp
|
||||
echo "===================================================================================" >> $scoredir/temp
|
||||
echo "Extracted file names and other data (extracted automatically; errors are possible):" >> $scoredir/temp
|
||||
echo "===================================================================================" >> $scoredir/temp
|
||||
echo "source language : $lang1" >> $scoredir/temp
|
||||
echo "target language : $lang2" >> $scoredir/temp
|
||||
echo "-----------------------------------------------------------------------------------" >> $scoredir/temp
|
||||
echo "source file : $sourcelanguagedir/$s" >> $scoredir/temp
|
||||
echo "moses translation : $mosestranslationdir/$m" >> $scoredir/temp
|
||||
echo "reference file : $reftranslationdir/$r" >> $scoredir/temp
|
||||
echo "-----------------------------------------------------------------------------------" >> $scoredir/temp
|
||||
echo "batch_user_note : $batch_user_note" >> $scoredir/temp
|
||||
echo "===================================================================================" >> $scoredir/temp
|
||||
echo "score_line_by_line : $score_line_by_line" >> $scoredir/temp
|
||||
if [ "$score_line_by_line" = "1" ]; then
|
||||
echo "tokenize : $tokenize" >> $scoredir/temp
|
||||
echo "lowercase : $lowercase" >> $scoredir/temp
|
||||
echo "remove_equal : $remove_equal" >> $scoredir/temp
|
||||
fi
|
||||
echo "===================================================================================" >> $scoredir/temp
|
||||
#=========================================================================================================================================================
|
||||
#1. SCORE LINE BY LINE
|
||||
#=========================================================================================================================================================
|
||||
if [ "$score_line_by_line" = "1" ]; then
|
||||
if [ -f $scoredir/$scorefile ]; then
|
||||
rm -f $scoredir/$scorefile
|
||||
fi
|
||||
echo "************************** Score line by line"
|
||||
counter=0
|
||||
echo "BLEU|NIST|<segnum>|source seg|ref seg|Moses seg" >> $scoredir/temp
|
||||
echo "" >> $scoredir/temp
|
||||
|
||||
sed -e 's#\& #\&\; #g' -e 's#<#\<\;#g' $scoredir/$s > $scoredir/$s.tmp
|
||||
mv $scoredir/$s.tmp $scoredir/$s
|
||||
sed -e 's#\& #\&\; #g' -e 's#<#\<\;#g' $scoredir/$r > $scoredir/$r.tmp
|
||||
mv $scoredir/$r.tmp $scoredir/$r
|
||||
sed -e 's#\& #\&\; #g' -e 's#<#\<\;#g' $scoredir/$m > $scoredir/$m.tmp
|
||||
mv $scoredir/$m.tmp $scoredir/$m
|
||||
echo "***** Score each segment:"
|
||||
while [ "$counter" -lt "$lines" ]; do
|
||||
let "counter += 1"
|
||||
echo "Segment $counter"
|
||||
source_sentence=`awk "NR==$counter{print;exit}" $scoredir/$s`
|
||||
ref_sentence=`awk "NR==$counter{print;exit}" $scoredir/$r`
|
||||
moses_sentence=`awk "NR==$counter{print;exit}" $scoredir/$m`
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ******** wrap source file
|
||||
if [ "$source_sentence" != "" ]; then
|
||||
echo '<srcset setid="'$scorebasename'" srclang="'$lang1'">' > $scoredir/$scorebasename-src.$lang1.sgm
|
||||
echo '<DOC docid="'$scorebasename'">' >> $scoredir/$scorebasename-src.$lang1.sgm
|
||||
echo "<seg id=$counter>"$source_sentence"</seg>" >> $scoredir/$scorebasename-src.$lang1.sgm
|
||||
echo "</DOC>" >> $scoredir/$scorebasename-src.$lang1.sgm
|
||||
echo "</srcset>" >> $scoredir/$scorebasename-src.$lang1.sgm
|
||||
fi
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ******** wrap reference (human-made) translation
|
||||
if [ "$ref_sentence" != "" ]; then
|
||||
echo '<refset setid="'$scorebasename'" srclang="'$lang1'" trglang="'$lang2'">' > $scoredir/$scorebasename-ref.$lang2.sgm
|
||||
echo '<DOC docid="'$scorebasename'" sysid="ref">' >> $scoredir/$scorebasename-ref.$lang2.sgm
|
||||
echo "<seg id=$counter>"$ref_sentence"</seg>" >> $scoredir/$scorebasename-ref.$lang2.sgm
|
||||
echo "</DOC>" >> $scoredir/$scorebasename-ref.$lang2.sgm
|
||||
echo "</refset>" >> $scoredir/$scorebasename-ref.$lang2.sgm
|
||||
fi
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
# ******** wrap Moses translation
|
||||
if [ "$moses_sentence" != "" ]; then
|
||||
echo '<tstset setid="'$scorebasename'" srclang="'$lang1'" trglang="'$lang2'">' > $scoredir/$scorebasename.moses.sgm
|
||||
echo '<DOC docid="'$scorebasename'" sysid="moses">' >> $scoredir/$scorebasename.moses.sgm
|
||||
echo "<seg id=$counter>"$moses_sentence"</seg>" >> $scoredir/$scorebasename.moses.sgm
|
||||
echo "</DOC>" >> $scoredir/$scorebasename.moses.sgm
|
||||
echo "</tstset>" >> $scoredir/$scorebasename.moses.sgm
|
||||
fi
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
sed -e 's/\x1E/\-/g' $scoredir/$scorebasename-src.$lang1.sgm > $scoredir/temp2
|
||||
mv $scoredir/temp2 $scoredir/$scorebasename-src.$lang1.sgm
|
||||
sed -e 's/\x1E/\-/g' $scoredir/$scorebasename-ref.$lang2.sgm > $scoredir/temp2
|
||||
mv $scoredir/temp2 $scoredir/$scorebasename-ref.$lang2.sgm
|
||||
sed -e 's/\x1E/\-/g' $scoredir/$scorebasename.moses.sgm > $scoredir/temp2
|
||||
mv $scoredir/temp2 $scoredir/$scorebasename.moses.sgm
|
||||
|
||||
# ******** get segment score"
|
||||
#in our experience, the mteval-v13a and the mteval-v12 (more recent scorers) stopped with errors (and no score) with strings like " & " and U+001E
|
||||
score=`$toolsdir/mteval-v11b.pl -s $scoredir/$scorebasename-src.$lang1.sgm -r $scoredir/$scorebasename-ref.$lang2.sgm -t $scoredir/$scorebasename.moses.sgm -c`
|
||||
scoretemp=${score%% for system *}
|
||||
scoretemp1=${scoretemp#*NIST score = }
|
||||
NIST=${scoretemp1%% *}
|
||||
BLEUtemp=${scoretemp1#*BLEU score = }
|
||||
BLEU=${BLEUtemp%% *}
|
||||
set -f
|
||||
BLEUcorr=$(echo "scale=0; $BLEU*10000" | bc)
|
||||
set +f
|
||||
if [ "$remove_equal" = "1" ]; then
|
||||
if [ "$ref_sentence" != "$moses_sentence" ]; then
|
||||
echo "$BLEU|$NIST|<$counter>|<seg>$source_sentence</seg>|<seg>$ref_sentence</seg>|<seg>$moses_sentence</seg>" >> $scoredir/$scorefile
|
||||
elif [ "$BLEUcorr" = "0" ]; then
|
||||
: #do nothing
|
||||
else
|
||||
echo "$BLEU|$NIST|<$counter>|<seg>$source_sentence</seg>|<seg>$ref_sentence</seg>|<seg>$moses_sentence</seg>" >> $scoredir/$scorefile
|
||||
fi
|
||||
else
|
||||
echo "$BLEU|$NIST|<$counter>|<seg>$source_sentence</seg>|<seg>$ref_sentence</seg>|<seg>$moses_sentence</seg>" >> $scoredir/$scorefile
|
||||
fi
|
||||
done
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
#Sort the output file by score
|
||||
sort -g $scoredir/$scorefile -o $scoredir/$scorefile
|
||||
echo "===========================================================================" >> $scoredir/temp
|
||||
cat $scoredir/$scorefile >> $scoredir/temp
|
||||
mv $scoredir/temp $scoredir/$scorefile
|
||||
remove_garbage
|
||||
else
|
||||
#=========================================================================================================================================================
|
||||
#2. SCORE WHOLE DOCUMENT
|
||||
#=========================================================================================================================================================
|
||||
if [ -f $scoredir/$scorefile ]; then
|
||||
rm -f $scoredir/$scorefile
|
||||
fi
|
||||
echo "************************** Score whole document"
|
||||
sed -e 's#\& #\&\; #g' -e 's#<#\<\;#g' $scoredir/$s > $scoredir/$s.tmp
|
||||
mv $scoredir/$s.tmp $scoredir/$s
|
||||
sed -e 's#\& #\&\; #g' -e 's#<#\<\;#g' $scoredir/$r > $scoredir/$r.tmp
|
||||
mv $scoredir/$r.tmp $scoredir/$r
|
||||
sed -e 's#\& #\&\; #g' -e 's#<#\<\;#g' $scoredir/$m > $scoredir/$m.tmp
|
||||
mv $scoredir/$m.tmp $scoredir/$m
|
||||
echo "***************** wrap test result in SGM"
|
||||
echo "******** wrap source file"
|
||||
exec<$scoredir/$s
|
||||
echo '<srcset setid="'$scorebasename'" srclang="'$lang1'">' > $scoredir/$scorebasename-src.$lang1.sgm
|
||||
echo '<DOC docid="'$scorebasename'">' >> $scoredir/$scorebasename-src.$lang1.sgm
|
||||
numseg=0
|
||||
while read line
|
||||
do
|
||||
numseg=$(($numseg+1))
|
||||
echo "<seg id=$numseg>"$line"</seg>" >> $scoredir/$scorebasename-src.$lang1.sgm
|
||||
done
|
||||
echo "</DOC>" >> $scoredir/$scorebasename-src.$lang1.sgm
|
||||
echo "</srcset>" >> $scoredir/$scorebasename-src.$lang1.sgm
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
echo "******** wrap reference (human-made) translation"
|
||||
exec<$scoredir/$r
|
||||
echo '<refset setid="'$scorebasename'" srclang="'$lang1'" trglang="'$lang2'">' > $scoredir/$scorebasename-ref.$lang2.sgm
|
||||
echo '<DOC docid="'$scorebasename'" sysid="ref">' >> $scoredir/$scorebasename-ref.$lang2.sgm
|
||||
numseg=0
|
||||
while read line
|
||||
do
|
||||
numseg=$(($numseg+1))
|
||||
echo "<seg id=$numseg>"$line"</seg>" >> $scoredir/$scorebasename-ref.$lang2.sgm
|
||||
done
|
||||
echo "</DOC>" >> $scoredir/$scorebasename-ref.$lang2.sgm
|
||||
echo "</refset>" >> $scoredir/$scorebasename-ref.$lang2.sgm
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
echo "******** wrap Moses translation"
|
||||
exec<$scoredir/$m
|
||||
echo '<tstset setid="'$scorebasename'" srclang="'$lang1'" trglang="'$lang2'">' > $scoredir/$scorebasename.moses.sgm
|
||||
echo '<DOC docid="'$scorebasename'" sysid="moses">' >> $scoredir/$scorebasename.moses.sgm
|
||||
numseg=0
|
||||
while read line
|
||||
do
|
||||
numseg=$(($numseg+1))
|
||||
echo "<seg id=$numseg>"$line"</seg>" >> $scoredir/$scorebasename.moses.sgm
|
||||
done
|
||||
echo "</DOC>" >> $scoredir/$scorebasename.moses.sgm
|
||||
echo "</tstset>" >> $scoredir/$scorebasename.moses.sgm
|
||||
|
||||
sed -e 's/\x1E/\-/g' $scoredir/$scorebasename-src.$lang1.sgm > $scoredir/temp2
|
||||
mv $scoredir/temp2 $scoredir/$scorebasename-src.$lang1.sgm
|
||||
sed -e 's/\x1E/\-/g' $scoredir/$scorebasename-ref.$lang2.sgm > $scoredir/temp2
|
||||
mv $scoredir/temp2 $scoredir/$scorebasename-ref.$lang2.sgm
|
||||
sed -e 's/\x1E/\-/g' $scoredir/$scorebasename.moses.sgm > $scoredir/temp2
|
||||
mv $scoredir/temp2 $scoredir/$scorebasename.moses.sgm
|
||||
|
||||
if [ ! -f $scoredir/$scorebasename-src.$lang1.sgm -o ! -f $scoredir/$scorebasename-ref.$lang2.sgm -o ! -f $scoredir/$scorebasename.moses.sgm ]; then
|
||||
echo "There was a problem creating the files used by the scorer. Exiting..."
|
||||
IFS=$SAVEIFS
|
||||
exit 0
|
||||
else
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
echo "***************** scoring"
|
||||
startscoringdate=`date +day:%d/%m/%y-time:%H:%M:%S`
|
||||
#in our experience, the mteval-v13a and the mteval-v12 (more recent scorers) stopped with errors (and no score) with strings like " & " and U+001E
|
||||
score=`$toolsdir/mteval-v11b.pl -s $scoredir/$scorebasename-src.$lang1.sgm -r $scoredir/$scorebasename-ref.$lang2.sgm -t $scoredir/$scorebasename.moses.sgm -c`
|
||||
scoretemp=${score%% for system *}
|
||||
scoretemp1=${scoretemp#*NIST score = }
|
||||
NIST=${scoretemp1%% *}
|
||||
BLEUtemp=${scoretemp1#*BLEU score = }
|
||||
BLEU=${BLEUtemp%% *}
|
||||
echo $score
|
||||
scoretemp2=${score#*NIST score =}
|
||||
echo "NIST score = $scoretemp2" > $scoredir/$scorefile
|
||||
newscorefile=$scorebasename-BLEU-$BLEU-NIST-$NIST-$batch_user_note-$lang1-$lang2.F-$scoreTMXdocuments-R-$remove_equal-T-$tokenize.L-$lowercase.whole-doc
|
||||
echo "===================================================================================" >> $scoredir/$scorefile
|
||||
mv -f $scoredir/$scorefile $scoredir/$newscorefile
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
fi
|
||||
cat $scoredir/$newscorefile >> $scoredir/temp
|
||||
mv $scoredir/temp $scoredir/$newscorefile
|
||||
remove_garbage
|
||||
fi
|
||||
else
|
||||
filename=${filetoscore##*/}
|
||||
if [ "$filename" != "*" ]; then
|
||||
let i=$i+1
|
||||
echo "--------------------------------------------------------------------"
|
||||
echo -e "$filename file (in the $mosestranslationdir directory):\n\tName of moses translation file is illegal (doesn't end in '.moses' or includes spaces)."
|
||||
error_msg="Name of moses translation file is illegal (doesn't end in '.moses' or includes spaces)."
|
||||
log_wrong_file
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS=$SAVEIFS
|
||||
|
||||
echo "--------------------------------------------------------------------"
|
||||
echo -e "Score finished.\n$i files treated.\nResults directory:\n\t$scoredir"
|
||||
#=================================================================================================================================================
|
||||
# Changes in version 0.85
|
||||
#=================================================================================================================================================
|
||||
# Allows batch processing of the whole $mosesdir/$translation_output directory
|
||||
# Extracts automatically the source language and target language, the names of the source file, moses translation file and reference translation file and the batch_user_note
|
||||
# Checks for more file naming errors and informs about them
|
||||
# More informative report, even in case of error
|
||||
# Creation of a new file that lists the translations that could not be scored and the reason why
|
||||
# Corrects a bug that made it fail when the scorer files included the word "for" in their name
|
||||
# Maintains SGM scorer because newer scorers have caused us more problems with characters that crashed them (ex: " & " and U+001E)
|
||||
#=================================================================================================================================================
|
||||
|
@ -1,55 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# transfer-training-to-another-location-0.07
|
||||
# copyright 2010 João L. A. C. Rosas
|
||||
# date: 27/02/2010
|
||||
# licenced under the GPL licence, version 3
|
||||
# Special thanks to Hilário Leal Fontes and Maria José Machado, who helped to test the script and made very helpful suggestions
|
||||
|
||||
# ***Purpose***: Create a copy of your trained corpora that can be used by someone else (even if in another computer) or by you yourself in a different Moses installation (you can have more than one Moses installation in the same computer). Your $mosesdir is written literally (e.g., "/home/john") in several trained corpora files. You have to change that string so that it reflects the $mosesdir to which you want to transfer your trainings. This script locates your $mosesdir string in your trained corpora files and substitutes it by the equivalent $mosesdir string that defines the location where you want your trainings transferred to. It creates a $mosesdir/corpora_trained_for_another_location/newusername directory, within which it will create the corpora_trained and logs directory prepared for the other user/Moses installation. Takes a good while to run if you have trained very large corpora.
|
||||
|
||||
############################################################################################################################################
|
||||
# THIS SCRIPT ASSUMES THAT A IRSTLM AND RANDLM ENABLED MOSES HAS ALREADY BEEN INSTALLED WITH THE create script IN $mosesdir; ITS #
|
||||
# DEFAULT VALUE IS $HOME/moses-irstlm-randlm; CHANGE THIS VARIABLE IF YOU WANT IT TO REFER TO A DIFFERENT LOCATION. #
|
||||
# IT ALSO ASSUMES THAT THE TRAINING OF A CORPUS HAS ALREADY BEEN DONE WITH train-moses-irstlm-randlm. #
|
||||
############################################################################################################################################
|
||||
|
||||
############################################################################################################################################
|
||||
# The values of the variables that follow should be filled according to your needs: #
|
||||
############################################################################################################################################
|
||||
# Base dir of your the Moses system (e.g., $HOME/moses-irstlm-randlm) whose trainings you want to transfer (!!! you have to fill this parameter !!!)
|
||||
mosesdirmine=$HOME/moses-irstlm-randlm
|
||||
# ***Login name*** of the user to whom the trained corpora will be transferred; ex: "john" (!!! you have to fill this parameter !!!)
|
||||
newusername=john
|
||||
# Basedir of the Moses system of the user to which the trained corpora will be transferred; ex: "/media/1.5TB/moses-irstlm-randlm" (!!! you have to fill this parameter !!!)
|
||||
mosesdirotheruser=
|
||||
############################################################################################################################################
|
||||
#end of parameters that you should fill #
|
||||
############################################################################################################################################
|
||||
|
||||
############################################################################################################################################
|
||||
# DON'T CHANGE THE LINES THAT FOLLOW ... unless you know what you are doing! #
|
||||
############################################################################################################################################
|
||||
# Register start date and time of corpus training
|
||||
startdate=`date +day:%d/%m/%y-time:%H:%M:%S`
|
||||
#Base dir of trained corpora
|
||||
corporatraineddir=$mosesdirmine/corpora_trained
|
||||
#Base dir of copy of your trained corpora prepared to be used by user $newusername
|
||||
corporatoexchange=$mosesdirmine/corpora_trained_for_another_location/$newusername
|
||||
if [ ! -d $corporatoexchange ]; then
|
||||
mkdir -p $corporatoexchange
|
||||
fi
|
||||
|
||||
echo "Please wait. This can take a long time if $mosesdirmine has many trained corpora or especially large trained corpora..."
|
||||
#copy present corporatraineddir to a safe place
|
||||
cp -rf $mosesdirmine/corpora_trained $corporatoexchange
|
||||
cp -rf $mosesdirmine/logs $corporatoexchange
|
||||
|
||||
if [ -d $corporatoexchange ]; then
|
||||
cd $corporatoexchange
|
||||
grep -lr -e "$mosesdirmine" * | xargs sed -i "s#$mosesdirmine#$mosesdirotheruser#g"
|
||||
fi
|
||||
echo ""
|
||||
echo "Processing done. The trained corpora prepared for user $newusername are located in the $corporatoexchange directory. Please transfer manually its corpora_trained and logs subdirectories to the $mosesdirotheruser directory. YOU ARE STRONGLY ADVISED TO MAKE A BACKUP OF THIS LATTER DIRECTORY BEFORE THAT TRANSFER. After having done it, you can safely erase the $mosesdirmine/corpora_trained_for_another_location directory. Your trained corpora in $mosesdirmine were not changed."
|
||||
echo "Starting time: $startdate"
|
||||
echo "End time : `date +day:%d/%m/%y-time:%H:%M:%S`"
|
||||
|
@ -1,453 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# translate-1.32
|
||||
# copyright 2010 João L. A. C. Rosas
|
||||
# date: 11/09/2010
|
||||
# licenced under the GPL licence, version 3
|
||||
# the Mosesdecoder (http://sourceforge.net/projects/mosesdecoder/), is a tool upon which this script depends that is licenced under the GNU Library or Lesser General Public License (LGPL)
|
||||
# The comments transcribe parts of the Moses manual (http://www.statmt.org/moses/manual/manual.pdf).
|
||||
# Special thanks to Hilário Leal Fontes and Maria José Machado, who helped to test the script and made very helpful suggestions
|
||||
|
||||
# ***Purpose***: Given a set of documents for translation in $mosesdir/translation_input, this script produces the Moses translation of that set of documents. If its $translate_for_tmx parameter is set to 1, it segments better the input file, erases empty and repeated segments and some types of segments containing just non-alphabetic characters and produces a translation adapted to the TMX specification of translation memories. The modified input file and its translation are placed in the $mosesdir/files_for_tmx directory. If the $translate_for_tmx is set to a value different from 1, this script translates the unchanged input document and its translation is placed in the $mosesdir/translation_output directory.
|
||||
|
||||
############################################################################################################################################
|
||||
# THIS SCRIPT ASSUMES THAT A IRSTLM AND RANDLM ENABLED MOSES HAS ALREADY BEEN INSTALLED WITH the create script IN $mosesdir, WHOSE #
|
||||
# DEFAULT VALUE IS $HOME/moses-irstlm-randlm; CHANGE THIS VARIABLE IF YOU WANT IT TO REFER TO A DIFFERENT LOCATION. #
|
||||
# IT ALSO ASSUMES THAT THE TRAINING OF A CORPUS HAS ALREADY BEEN DONE WITH THE train script. #
|
||||
# IT FINALLY ASSUMES THAT YOU HAVE PLACED THE DOCUMENTS TO BE TRANSLATED IN THE $mosesdir/translation_input DIRECTORY #
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #
|
||||
# !!! The names of the files to be translated should not include spaces !!! #
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #
|
||||
# The names of the files to be translated MUST observe the following convention: #
|
||||
# <basename>.<abbreviation of source language> (ex: 100.en) #
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #
|
||||
############################################################################################################################################
|
||||
|
||||
############################################################################################################################################
|
||||
# The values of the variables that follow should be filled according to your needs: #
|
||||
############################################################################################################################################
|
||||
|
||||
#Full path of the base directory location of your Moses system
|
||||
mosesdir=$HOME/moses-irstlm-randlm
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
# Even if you are using the demonstration corpus, you have to fill the $logfile parameter so that the script can be executed !!!
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
#Name of the log file of the corpus to be used (time-saving tip: copy and paste it here; the default directory of the log files is $mosesdir/logs); example of a possible name of a log file: pt-en.C-200000.for_train-60-1.LM-300000.MM-1.day-18-01-10-time-14-08-50.txt) (!!! omit the path !!!; you MUST fill in this parameter !!!)
|
||||
logfile=
|
||||
#Create a translation report when translations are finished; 1 = Do; Any other value = Do not
|
||||
create_translation_report=1
|
||||
|
||||
#-----------------------------------------------------*** TMX OPTIONS ***---------------------------------------------------------------------------------
|
||||
|
||||
#Process both the document to be translated and the Moses translation so that the machine translation can be used with a translation memory tool
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
#!!! If you set this parameter to 1, you MUST NOT use the score script unless the $othercleanings, $improvesegmentation and $ removeduplicates parameters are all set to 0 and $minseglen is set to -1, since this processing changes the order of the segments and can also make the source document have a number of segments that is different from the number of segments of the reference translation (namely because it can delete some segments and/or add some new ones) !!!
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
translate_for_tmx=0
|
||||
#Minimal length of sentences; -1=any length; any other value=segments with less than $minseglen will be erased ( !!! only active if translate_for_tmx =1 !!!)
|
||||
minseglen=-1
|
||||
#Substitute tabulation signs by newlines and remove lines composed only of digits, spaces and parentheses ( !!! only active if translate_for_tmx = 1 !!!)
|
||||
othercleanings=1
|
||||
# Substitute any of the characters [:;.!?] followed by a space by that character followed by a newline; delete empty lines; substitute doublespaces by one space ( !!! only active if translate_for_tmx = 1 !!!)
|
||||
improvesegmentation=1
|
||||
#Sort segments and remove those segments that are identical ( !!! only active if translate_for_tmx =1 !!! )
|
||||
removeduplicates=1
|
||||
|
||||
#-----------------------------------------------------*** MOSES DECODER PARAMETERS ***--------------------------------------------------------------------
|
||||
|
||||
#***** QUALITY TUNING:
|
||||
# Weights for phrase translation table (good values: 0.1-1; default: 1); ensures that the phrases are good translations of each other
|
||||
weight_t=1
|
||||
# Weights for language model (good values: 0.1-1; default: 1); ensures that output is fluent in target language
|
||||
weight_l=1
|
||||
# Weights for reordering model (good values: 0.1-1; default: 1); allows reordering of the input sentence
|
||||
weight_d=1
|
||||
# Weights for word penalty (good values: -3 to 3; default: 0; negative values favor large output; positive values favour short output); ensures translations do not get too long or too short
|
||||
weight_w=0
|
||||
#------------------------------------------
|
||||
# Use Minumum Bayes Risk (MBR) decoding (1 = Do; Any other value = do not); instead of outputting the translation with the highest probability, MBR decoding outputs the translation that is most similar to the most likely translations.
|
||||
mbr=0
|
||||
# Number of translation candidates consider. MBR decoding uses by default the top 200 distinct candidate translations to find the translation with minimum Bayes risk
|
||||
mbrsize=200
|
||||
# Scaling factor used to adjust the translation scores (default = 1.0)
|
||||
mbrscale=1.0
|
||||
# Adds walls around punctuation ,.!?:;". 1= Do; Any other value = do not. Specifying reordering constraints around punctuation is often a good idea. TODO not sure it does not require annotation of the corpus to be trained
|
||||
monotoneatpunctuation=0
|
||||
#***** SPEED TUNING:
|
||||
# Fixed limit for how many translation options are retrieved for each input phrase (0 = no limit; positive value = number of translation options per phrase)
|
||||
ttablelimit=20
|
||||
# Use the relative scores of hypothesis for pruning, instead of a fixed limit (0= no pruning; decimal value = more pruning)
|
||||
beamthreshold=0
|
||||
# Threshold for constructing hypotheses based on estimate cost (default: 0 = not used). During the beam search, many hypotheses are created that are too bad to be even entered on a stack. For many of them, it is even clear before the construction of the hypothesis that it would be not useful. Early discarding of such hypotheses hazards a guess about their viability. This is based on correct score except for the actual language model costs which are very expensive to compute. Hypotheses that, according to this estimate, are worse than the worst hypothesis of the target stack, even given an additional specified threshold as cushion, are not constructed at all. This often speeds up decoding significantly. Try threshold factors between 0.5 and 1
|
||||
earlydiscardingthreshold=0
|
||||
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
#To get faster performance than the default Moses setting at roughly the same performance, use the parameter settings $searchalgorithm=1, $cubepruningpoplimit=2000 and $stack=2000. With cube pruning, the size of the stack has little impact on performance, so it should be set rather high. The speed/quality trade-off is mostly regulated by the -cube-pruning-pop-limit, i.e. the number of hypotheses added to each stack
|
||||
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
# Search algorithm; cube pruning is faster than the traditional search at comparable levels of search errors; 0 = default; 1 = turns on cube pruning
|
||||
searchalgorithm=0
|
||||
# Number of hypotheses added to each stack; only a fixed number of hypotheses are generated for each span; default is 1000, higher numbers slow down the decoder, may result in better quality
|
||||
cubepruningpoplimit=1000
|
||||
# Reduce size of hypothesis stack, that keeps the best partial translations (=beam); default: 100
|
||||
stack=100
|
||||
# Maximum phrase length (default: 20) TODO not sure to what it refers
|
||||
maxphraselength=20
|
||||
# ****** SPEED AND QUALITY TUNING
|
||||
# Minimum number of hypotheses from each coverage pattern; you may also require that a minimum number of hypotheses is added for each word coverage (they may be still pruned out, however). This is done using the switch -cube-pruning-diversity, which sets the minimum. The default is 0
|
||||
cubepruningdiversity=0
|
||||
# Distortion (reordering) limit in maximum number of words (0 = monotone; -1 = unlimited ; any other positive value = maximal number of words; default:6)); limiting distortion often increases speed and quality
|
||||
distortionlimit=6
|
||||
|
||||
############################################################################################################################################
|
||||
#end of parameters that you should fill #
|
||||
############################################################################################################################################
|
||||
|
||||
|
||||
############################################################################################################################################
|
||||
# DON'T CHANGE THE LINES THAT FOLLOW ... unless you know what you are doing! #
|
||||
############################################################################################################################################
|
||||
startdate=`date +day:%d/%m/%y-time:%H:%M:%S`
|
||||
echo "********************************** DO PREPARATORY WORK:"
|
||||
|
||||
#to avoid *** glibc detected *** errors with moses compiler
|
||||
export MALLOC_CHECK_=0
|
||||
|
||||
if [ "$logfile" = "" ]; then
|
||||
echo "In order to use this script, you have to at least fill its \$logfile parameter. Its allowable values are the names of the files located in $mosesdir/logs. You should also not forget to put the files to be translated in the $mosesdir/translation_input directory. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "****** Set some important directories"
|
||||
#Base directory of corpora training logfiles
|
||||
logdir=$mosesdir/logs
|
||||
#Name of the directory where files to be translated are placed by the user
|
||||
docs_to_translate_dir="$mosesdir/translation_input"
|
||||
#Name of the directory where reference (man-made) translated files are located
|
||||
translation_reference_dir="$mosesdir/translation_reference"
|
||||
#Name of the directory where translated files not to be used to create TMX files are placed
|
||||
translated_docs_dir="$mosesdir/translation_output"
|
||||
#Name of the directory where translated files used to create a TMX memory are placed (both source and target segments will be placed there)
|
||||
commonplacefortmx="$mosesdir/translation_files_for_tmx"
|
||||
if [ "$translate_for_tmx" = "1" ]; then
|
||||
outputdir=$commonplacefortmx
|
||||
else
|
||||
outputdir=$translated_docs_dir
|
||||
fi
|
||||
#Full path of the trained corpus files directory
|
||||
workdir=$mosesdir/corpora_trained
|
||||
#Full path of the tools (Moses, etc.) directory
|
||||
toolsdir=$mosesdir/tools
|
||||
stampdate=`date +day-%d-%m-%y-time-%H-%M-%S`
|
||||
#Full path of a temporary directory used for translating
|
||||
tmp=$mosesdir/$stampdate
|
||||
|
||||
echo "check that log file exists"
|
||||
if [ ! -f $logdir/$logfile ]; then
|
||||
echo "The log file you are trying to use ($logdir/$logfile) does not exist (please check). You may be using a log file of a previous training that you have already moved or erased. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if `echo ${logfile} | grep "!!!INVALID!!!" 1>/dev/null 2>&1`; then
|
||||
echo "The log file you are trying to use ($logdir/$logfile) points to a deficiently trained corpus. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "****** Set some important variables"
|
||||
#Extract first language name
|
||||
lang1=`grep lang1 $logdir/$logfile | sed -e 's/.*lang1=\(\S*\).*/\1/g'`
|
||||
#Extract second language name
|
||||
lang2=`grep lang2 $logdir/$logfile | sed -e 's/.*lang2=\(\S*\).*/\1/g'`
|
||||
#Extract corpus name
|
||||
corpusbasename=`grep corpusbasename $logdir/$logfile | sed -e 's/.*corpusbasename=\(\S*\).*/\1/g'`
|
||||
#Extract language parameters
|
||||
lngmdlparameters=`grep language-model-parameters $logdir/$logfile | sed -e 's/.*language-model-parameters=\(\S*\).*/\1/g'`
|
||||
#Extract LM name
|
||||
lmbasenametemp=${lngmdlparameters#LM-*}
|
||||
lmbasename=${lmbasenametemp%%-*}
|
||||
#Extract training parameters
|
||||
trainingparameters=`grep training-parameters $logdir/$logfile | sed -e 's/\/*training-parameters=\(\S*\)*$/\1/g'`
|
||||
#Extract memorymapping parameters
|
||||
mm=`grep memory-mapping-parameters $logdir/$logfile | sed -e 's/\/*memory-mapping-parameters=\(\S*\)*$/\1/g'`
|
||||
param=`grep memory-mapping-extra-parameters $logdir/$logfile | sed -e 's/\/*memory-mapping-extra-parameters=\(\S*\)*$/\1/g'`
|
||||
tuningparameters=`grep tuning-parameters $logdir/$logfile | sed -e 's/\/*tuning-parameters=\(\S*\)*$/\1/g'`
|
||||
if [ "$tuningparameters" != "Tu-0" ]; then
|
||||
tuning=1
|
||||
else
|
||||
tuning=0
|
||||
fi
|
||||
#Extract $MinLen parameter
|
||||
MinLen=`grep minseglen $logdir/$logfile | sed -e 's/\/*minseglen=\(\S*\)*$/\1/g'`
|
||||
#Extract $MaxLen parameter
|
||||
MaxLen=`grep maxlen $logdir/$logfile | sed -e 's/\/*maxlen=\(\S*\)*$/\1/g'`
|
||||
#Extract $recaserbasename parameter
|
||||
recaserbasename=`grep recaserbasename $logdir/$logfile | sed -e 's/\/*recaserbasename=\(\S*\)*$/\1/g'`
|
||||
reportname="translation_summary-`date +day-%d-%m-%y-time-%H-%M-%S`"
|
||||
|
||||
echo "****** Build name of directories where training files are located"
|
||||
#Full path of the tools directory (giza, irstlm, moses, scripts, ...)
|
||||
toolsdir="$mosesdir/tools"
|
||||
#Full path of the tools subdirectory where modified scripts are located
|
||||
modifiedscriptsdir="$toolsdir/modified-scripts"
|
||||
#Full path of the files used for training (corpus, language model, recaser, tuning, evaluation)
|
||||
datadir="$mosesdir/corpora_for_training"
|
||||
#Full path of the training logs
|
||||
logsdir="$mosesdir/logs"
|
||||
#Full path of the base directory where your corpus will be processed (corpus, model, lm, evaluation, recaser)
|
||||
workdir="$mosesdir/corpora_trained"
|
||||
#Full path of the language model directory
|
||||
lmdir="$workdir/lm/$lang2/$lngmdlparameters"
|
||||
#Full path of the tokenized files directory
|
||||
tokdir="$workdir/tok"
|
||||
#Full path of the cleaned files directory
|
||||
cleandir="$workdir/clean/MinLen-$MinLen.MaxLen-$MaxLen"
|
||||
#Full path of the lowercased (after cleaning) files directory
|
||||
lc_clean_dir="$workdir/lc_clean/MinLen-$MinLen.MaxLen-$MaxLen"
|
||||
#Full path of the lowercased (and not cleaned) files directory
|
||||
lc_no_clean_dir="$workdir/lc_no_clean"
|
||||
#Full path of the trained corpus files directory
|
||||
modeldir="$workdir/model/$lang1-$lang2-$corpusbasename.$lngmdlparameters/$trainingparameters"
|
||||
#Root-dir parameter of Moses
|
||||
rootdir=$modeldir
|
||||
#Full path of the memory-mapped files directory
|
||||
memmapsdir="$workdir/memmaps/$lang1-$lang2-$corpusbasename.$lngmdlparameters/$trainingparameters"
|
||||
if [ "$mm" = "1" ]; then
|
||||
mmparameters="M-1"
|
||||
else
|
||||
mmparameters="M-0"
|
||||
fi
|
||||
#Full path of the recaser files directory
|
||||
recaserdir="$workdir/recaser/$lang2/$recaserbasename-IRSTLM"
|
||||
#Full path of the detokenized files directory
|
||||
detokdir="$workdir/detok/$lang2/$testbasename"
|
||||
#Full path of the tuning files directory
|
||||
tuningdir="$workdir/tuning/$lang1-$lang2-$corpusbasename.$lngmdlparameters.$mmparameters.$tuningparameters/$trainingparameters"
|
||||
|
||||
#Choose the moses.ini file that best reflects the type of training done
|
||||
echo "using $mosesinidir"
|
||||
if [ "$tuning" = "1" ]; then
|
||||
mosesinidir=$tuningdir/moses.weight-reused.ini
|
||||
elif [ "$mm" = "1" ]; then
|
||||
mosesinidir=$memmapsdir/moses.ini
|
||||
else
|
||||
mosesinidir=$modeldir/moses.ini
|
||||
fi
|
||||
|
||||
echo "****** Create auxiliary routines"
|
||||
#function that avoids some unwanted effects of interrupting training
|
||||
control_c() {
|
||||
echo "******* Script interrupted by CTRL + C."
|
||||
exit 0
|
||||
}
|
||||
trap control_c SIGINT
|
||||
|
||||
#function that checks whether a trained corpus exists already
|
||||
checktrainedcorpusexists() {
|
||||
if [ ! -f $lmdir/$lang2.$lngmdlparameters.blm.mm -a ! -f $lmdir/$lang2.$lngmdlparameters.BloomMap ]; then
|
||||
echo "The trained corpus you are trying to use ($logdir/$logfile) wasn't correctly trained or does not exist. Its language model (for instance, file $lmdir/$lang2.$lngmdlparameters.blm.mm ***or** file $lmdir/$lang2.$lngmdlparameters.BloomMap) does not exist. Please train or retrain it, or use another trained corpus. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
if [ ! -f $recaserdir/phrase-table.$lang2.$recaserbasename.binphr.tgtvoc ]; then
|
||||
echo "The trained corpus you are trying to use ($logdir/$logfile) wasn't correctly trained or does not exist. Its recaser training (for instance, file $recaserdir/phrase-table.$lang2.$recaserbasename.binphr.tgtvoc) does not exist. Please train or retrain it, or use another trained corpus. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
if [ ! -f $mosesinidir -o ! -d $modeldir ]; then
|
||||
echo "The trained corpus you are trying to use ('$logdir/$logfile') wasn't correctly trained or does not exist. Its moses.ini file ($mosesinidir) ***or*** its training model directory ($modeldir) does not exist. Please train or retrain it, or use another trained corpus. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
if [ ! -f $memmapsdir/reordering-table.$corpusbasename.$lang1-$lang2.$param.binlexr.srctree ]; then
|
||||
echo "The trained corpus you are trying to use ($logdir/$logfile) wasn't correctly trained. You have chosen to train it with memory-mapping and the memory-mapping files (for instance, $memmapsdir/reordering-table.$corpusbasename.$lang1-$lang2.$param.binlexr.srctree) do not exist. Please train or retrain it, or use another trained corpus. Exiting ..."
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
echo "****** Check that selected training is OK"
|
||||
checktrainedcorpusexists
|
||||
|
||||
echo "****** Create some necessary directories if they do not yet exist"
|
||||
if [ ! -d $commonplacefortmx ]; then mkdir -p $commonplacefortmx; fi
|
||||
|
||||
if [ ! -d $docs_to_translate_dir ]; then
|
||||
mkdir -p $docs_to_translate_dir
|
||||
echo "You need to put the file(s) you want to translate in the $docs_to_translate_dir directory."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -d $translated_docs_dir ]; then mkdir -p $translated_docs_dir; fi
|
||||
|
||||
if [ ! -d $translation_reference_dir ]; then mkdir -p $translation_reference_dir; fi
|
||||
|
||||
if [ ! -d $tmp ]; then mkdir -p $tmp; fi
|
||||
|
||||
echo "****** Export some important variables"
|
||||
#base directory of Moses scripts
|
||||
export SCRIPTS_ROOTDIR=$toolsdir/moses/scripts*
|
||||
export IRSTLM=$toolsdir/irstlm
|
||||
export PATH=$toolsdir/irstlm/bin/i686:$toolsdir/irstlm/bin:$PATH
|
||||
export RANDLM=$toolsdir/randlm
|
||||
export PATH=$toolsdir/randlm/bin:$PATH
|
||||
export PATH=$toolsdir/mgiza:$PATH
|
||||
export QMT_HOME=$toolsdir/mgiza
|
||||
export corpusbasename
|
||||
export lmbasename
|
||||
export lang1
|
||||
export lang2
|
||||
|
||||
echo "********************************** TRANSLATE:"
|
||||
numtranslateddocs=0
|
||||
if (( $minseglen > 0 )); then
|
||||
let "minseglen -= 1"
|
||||
fi
|
||||
tmpfilename=`date +day-%d-%m-%y-time-%H-%M-%S`
|
||||
#Prepare and translate all the files in $docs_to_translate_dir OR do the demo of this script; present the results in $translated_docs_dir
|
||||
for filetotranslate in $docs_to_translate_dir/*; do
|
||||
echo $filetotranslate
|
||||
if [ -f $filetotranslate ]; then
|
||||
echo "********* $filetotranslate"
|
||||
fromdos $filetotranslate
|
||||
tr '\a\b\f\r\v|' ' /' < $filetotranslate > $filetotranslate.tmp
|
||||
mv $filetotranslate.tmp $filetotranslate
|
||||
name=${filetotranslate##*/}
|
||||
if [ ! -f $outputdir/$name.$lang2.moses ]; then
|
||||
if [ "$translate_for_tmx" = "1" ]; then
|
||||
cp $filetotranslate $tmp/$name
|
||||
echo "*** remove segments with less than $minseglen characters"
|
||||
if (( $minseglen > 0 )); then
|
||||
sed "/^.\{1,$minseglen\}$/d" < $tmp/$name > $tmp/$tmpfilename.txt
|
||||
mv $tmp/$tmpfilename.txt $tmp/$name
|
||||
fi
|
||||
echo "*** clean segments with non-alphanumeric characters"
|
||||
if [ "$othercleanings" = "1" ]; then
|
||||
sed "s#\t#\n#g; /^[0-9]\+$/d; /^[0-9.)( ]\+$/d" < $tmp/$name > $tmp/$tmpfilename.txt
|
||||
mv $tmp/$tmpfilename.txt $tmp/$name
|
||||
fi
|
||||
echo "*** improve segmentation"
|
||||
if [ "$improvesegmentation" = "1" ]; then
|
||||
sed "s#\: #\:\n#g; s#\. #.\n#g; s#\; #\;\n#g; s#\! #\!\n#g; s#\? #\?\n#g; s# # #g; s# # #g; s# # #g; s# # #g; s# # #g; s# # #g; s# # #g; /^$/d; /^$/d; /^$/d; /^$/d; /^$/d; /^$/d; /^ $/d" < $tmp/$name > $tmp/$tmpfilename.txt
|
||||
mv $tmp/$tmpfilename.txt $tmp/$name
|
||||
fi
|
||||
echo "*** sort and then remove duplicates"
|
||||
if [ "$removeduplicates" = "1" ]; then
|
||||
awk '!($0 in a) {a[$0];print}' $tmp/$name > $tmp/$tmpfilename.txt
|
||||
mv $tmp/$tmpfilename.txt $tmp/$name
|
||||
fi
|
||||
cp $tmp/$name $commonplacefortmx
|
||||
fi
|
||||
let "numtranslateddocs += 1"
|
||||
if [ "$translate_for_tmx" = "1" ]; then
|
||||
$toolsdir/scripts/tokenizer.perl -l $lang1 < $tmp/$name > $tmp/$name.tok
|
||||
else
|
||||
$toolsdir/scripts/tokenizer.perl -l $lang1 < $filetotranslate > $tmp/$name.tok
|
||||
fi
|
||||
$toolsdir/scripts/lowercase.perl < $tmp/$name.tok > $tmp/$name.lowercase
|
||||
echo "****** Translate"
|
||||
$toolsdir/moses/moses-cmd/src/moses -f $mosesinidir -weight-t $weight_t -weight-l $weight_l -weight-d $weight_d -weight-w $weight_w -mbr $mbr -mbr-size $mbrsize -mbr-scale $mbrscale -monotone-at-punctuation $monotoneatpunctuation -ttable-limit $ttablelimit -b $beamthreshold -early-discarding-threshold $earlydiscardingthreshold -search-algorithm $searchalgorithm -cube-pruning-pop-limit $cubepruningpoplimit -s $stack -max-phrase-length $maxphraselength -cube-pruning-diversity $cubepruningdiversity -distortion-limit $distortionlimit < $tmp/$name.lowercase > $tmp/$name.$lang2
|
||||
if [ -f $recaserdir/moses.ini ]; then
|
||||
echo "****** Recase the output"
|
||||
$toolsdir/moses/script*/recaser/recase.perl -model $recaserdir/moses.ini -in $tmp/$name.$lang2 -moses $toolsdir/moses/moses-cmd/src/moses > $tmp/$name.$lang2.recased
|
||||
recased=1
|
||||
fi
|
||||
echo "****** Detokenize the output"
|
||||
if [ "$recased" = "1" ]; then
|
||||
$toolsdir/scripts/detokenizer.perl -l $lang2 < $tmp/$name.$lang2.recased > $tmp/$name.$lang2.txt
|
||||
else
|
||||
$toolsdir/scripts/detokenizer.perl -l $lang2 < $tmp/$name.$lang2 > $tmp/$name.$lang2.txt
|
||||
fi
|
||||
if [ "$translate_for_tmx" = "1" ]; then
|
||||
sed "s#<#\<\;#g; s#>#\>\;#g; s#'#\&apos\;#g; s#\"#\"\;#g; s# / #/#g" < $tmp/$name.$lang2.txt > $commonplacefortmx/$name.$lang2.moses
|
||||
sed "s#<#\<\;#g; s#>#\>\;#g; s#'#\&apos\;#g; s#\"#\"\;#g; s# / #/#g" < $tmp/$name > $commonplacefortmx/$name
|
||||
else
|
||||
sed 's# / #/#g; s/\\$/\\ /g' < $tmp/$name.$lang2.txt > $tmp/$name.$lang2.txt1
|
||||
cp -f $tmp/$name.$lang2.txt1 $outputdir/$name.$lang2.moses
|
||||
fi
|
||||
else
|
||||
echo "Document $name has already been translated to $outputdir/$name.$lang2. Translation will not be repeated."
|
||||
fi
|
||||
fi
|
||||
done
|
||||
#Remove the now superfluous $mosesdir/temp directory
|
||||
if [ -d $tmp ]; then
|
||||
rm -rf $tmp
|
||||
fi
|
||||
if [ "$numtranslateddocs" = "0" ]; then
|
||||
echo "The \$docs_to_translate_dir ($docs_to_translate_dir) has no new documents to be translated. You should place there the documents you want to translate. It should have no subdirectories. Exiting ..."
|
||||
`find $tmp -type d -empty -exec rmdir {} \; 2>/dev/null`
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
if [ $create_translation_report -eq 1 ]; then
|
||||
echo "********************************** BUILD TRANSLATION REPORT:"
|
||||
echo "*** Script version ***: translate-1.32" > $outputdir/$reportname
|
||||
echo "========================================================================" >> $outputdir/$reportname
|
||||
echo "*** Duration ***: " >> $outputdir/$reportname
|
||||
echo "========================================================================" >> $outputdir/$reportname
|
||||
echo "Start time: $startdate" >> $outputdir/$reportname
|
||||
echo "End time: `date +day:%d/%m/%y-time:%H:%M:%S`" >> $outputdir/$reportname
|
||||
echo "========================================================================" >> $outputdir/$reportname
|
||||
echo "*** Moses base directory ***: $mosesdir" >> $outputdir/$reportname
|
||||
echo "========================================================================" >> $outputdir/$reportname
|
||||
echo "*** Languages*** :" >> $outputdir/$reportname
|
||||
echo "========================================================================" >> $outputdir/$reportname
|
||||
echo "Source language: $lang1" >> $outputdir/$reportname
|
||||
echo "Destination language: $lang2" >> $outputdir/$reportname
|
||||
echo "========================================================================" >> $outputdir/$reportname
|
||||
echo "*** Trained corpus used ***:" >> $outputdir/$reportname
|
||||
echo "========================================================================" >> $outputdir/$reportname
|
||||
if [[ ${logfile-_} ]]; then
|
||||
echo "$logfile" >> $outputdir/$reportname
|
||||
fi
|
||||
echo "========================================================================" >> $outputdir/$reportname
|
||||
echo "*** Translated Files ***:" >> $outputdir/$reportname
|
||||
echo "========================================================================" >> $outputdir/$reportname
|
||||
for filetotranslate in $docs_to_translate_dir/*.*; do
|
||||
if [[ ${filetotranslate-_} ]]; then
|
||||
echo "$filetotranslate" >> $outputdir/$reportname
|
||||
fi
|
||||
done
|
||||
echo "========================================================================" >> $outputdir/$reportname
|
||||
echo "*** TMX parameters ***:" >> $outputdir/$reportname
|
||||
echo "========================================================================" >> $outputdir/$reportname
|
||||
echo "translate_for_tmx=$translate_for_tmx" >> $outputdir/$reportname
|
||||
echo "minseglen=$minseglen" >> $outputdir/$reportname
|
||||
echo "========================================================================" >> $outputdir/$reportname
|
||||
echo "*** Moses decoder parameters ***:" >> $outputdir/$reportname
|
||||
echo "========================================================================" >> $outputdir/$reportname
|
||||
echo "********** Quality parameters **************" >> $outputdir/$reportname
|
||||
echo "weight-t=$weight_t" >> $outputdir/$reportname
|
||||
echo "weight-l=$weight_l" >> $outputdir/$reportname
|
||||
echo "weight-d=$weight_d" >> $outputdir/$reportname
|
||||
echo "weight-w=$weight_w" >> $outputdir/$reportname
|
||||
echo "mbr=$mbr" >> $outputdir/$reportname
|
||||
echo "mbr-size=$mbrsize" >> $outputdir/$reportname
|
||||
echo "mbr-scale=$mbrscale" >> $outputdir/$reportname
|
||||
echo "monotone-at-punctuation=$monotoneatpunctuation" >> $outputdir/$reportname
|
||||
echo "********** Speed parameters ****************" >> $outputdir/$reportname
|
||||
echo "ttable-limit=$ttablelimit" >> $outputdir/$reportname
|
||||
echo "beam-threshold=$beamthreshold" >> $outputdir/$reportname
|
||||
echo "early-discarding-threshold=$earlydiscardingthreshold" >> $outputdir/$reportname
|
||||
echo "search-algorithm=$searchalgorithm" >> $outputdir/$reportname
|
||||
echo "cube-pruning-pop-limit=$cubepruningpoplimit" >> $outputdir/$reportname
|
||||
echo "stack=$stack" >> $outputdir/$reportname
|
||||
echo "maxphraselength=$maxphraselength" >> $outputdir/$reportname
|
||||
echo "********** Quality and speed parameters ****" >> $outputdir/$reportname
|
||||
echo "cube-pruning-diversity=$cubepruningdiversity" >> $outputdir/$reportname
|
||||
echo "distortion-limit=$distortionlimit" >> $outputdir/$reportname
|
||||
fi
|
||||
|
||||
`find $tmp -type d -empty -exec rmdir {} \; 2>/dev/null`
|
||||
|
||||
echo "Translation finished. The translations and a summary report of the translation are located in the $outputdir directory."
|
||||
|
||||
#=================================================================================================================================================
|
||||
#Changed in version 1.32
|
||||
#=================================================================================================================================================
|
||||
# Adaptation to a change in the tofrodos package upon which this script depends
|
||||
# Better reactivity to user errors
|
||||
#=================================================================================================================================================
|
||||
#Changed in version 1.26
|
||||
#=================================================================================================================================================
|
||||
# Appends to the end of the name of the translated files ".$lang2.moses"
|
||||
# Does not translate files already translated
|
||||
# Tells user what to do if the $logfile parameter wasn't set
|
||||
# Special processing of translated files that will be used with a translation memory tool
|
@ -47,7 +47,7 @@
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WITH_THREADS;NO_PIPES;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
@ -55,7 +55,7 @@
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\boost\boost_1_47;$(SolutionDir)/../../moses/src;$(SolutionDir)/../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>C:\boost\boost_1_47;$(SolutionDir)/../../moses/src;$(SolutionDir)/../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>zdll.lib;$(SolutionDir)/$(Configuration)/moses.lib;$(SolutionDir)/$(Configuration)/kenlm.lib;$(SolutionDir)/$(Configuration)/OnDiskPt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
@ -68,14 +68,14 @@
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>WITH_THREADS;NO_PIPES;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\boost\boost_1_47;$(SolutionDir)/../../moses/src;$(SolutionDir)/../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>C:\boost\boost_1_47;$(SolutionDir)/../../moses/src;$(SolutionDir)/../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>zdll.lib;$(SolutionDir)/$(Configuration)/moses.lib;$(SolutionDir)/$(Configuration)/kenlm.lib;$(SolutionDir)/$(Configuration)/OnDiskPt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
|
@ -288,6 +288,7 @@
|
||||
../../irstlm/lib,
|
||||
../../srilm/lib/macosx,
|
||||
../../randlm/lib,
|
||||
/opt/local/lib,
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lz",
|
||||
@ -298,6 +299,7 @@
|
||||
"-lflm",
|
||||
"-llattice",
|
||||
"-lrandlm",
|
||||
"-lboost_thread-mt",
|
||||
);
|
||||
PRODUCT_NAME = CreateOnDisk;
|
||||
};
|
||||
@ -318,6 +320,7 @@
|
||||
../../irstlm/lib,
|
||||
../../srilm/lib/macosx,
|
||||
../../randlm/lib,
|
||||
/opt/local/lib,
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lz",
|
||||
@ -328,6 +331,7 @@
|
||||
"-lflm",
|
||||
"-llattice",
|
||||
"-lrandlm",
|
||||
"-lboost_thread-mt",
|
||||
);
|
||||
PRODUCT_NAME = CreateOnDisk;
|
||||
};
|
||||
|
@ -77,7 +77,7 @@
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)/../../moses/src;$(SolutionDir)/../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>C:\boost\boost_1_47;$(SolutionDir)/../../moses/src;$(SolutionDir)/../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
@ -91,7 +91,7 @@
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)/../../moses/src;$(SolutionDir)/../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>C:\boost\boost_1_47;$(SolutionDir)/../../moses/src;$(SolutionDir)/../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D2AAC045055464E500DB518D"
|
||||
BuildableName = "libOnDiskPt.a"
|
||||
BlueprintName = "OnDiskPt"
|
||||
ReferencedContainer = "container:OnDiskPt.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug">
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release">
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
311
contrib/other-builds/kbmira.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,311 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1E73031E1597355A00C0E7FB /* kbmira.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E73031D1597355A00C0E7FB /* kbmira.cpp */; };
|
||||
1EC060861597392900614957 /* libmert_lib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EC060821597386600614957 /* libmert_lib.a */; };
|
||||
1EC060B41597490F00614957 /* liblm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EC060B11597490800614957 /* liblm.a */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
1EC060811597386600614957 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 1EC0607A1597386500614957 /* mert_lib.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 1E2CCF3315939E2D00D858D1;
|
||||
remoteInfo = mert_lib;
|
||||
};
|
||||
1EC060841597386C00614957 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 1EC0607A1597386500614957 /* mert_lib.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 1E2CCF3215939E2D00D858D1;
|
||||
remoteInfo = mert_lib;
|
||||
};
|
||||
1EC060B01597490800614957 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 1EC060A51597490800614957 /* lm.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 1EE8C2E91476A48E002496F2;
|
||||
remoteInfo = lm;
|
||||
};
|
||||
1EC060B51597491400614957 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 1EC060A51597490800614957 /* lm.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 1EE8C2E81476A48E002496F2;
|
||||
remoteInfo = lm;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
1E43CA3E159734A5000E29D3 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = /usr/share/man/man1/;
|
||||
dstSubfolderSpec = 0;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 1;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1E43CA40159734A5000E29D3 /* kbmira */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = kbmira; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
1E73031D1597355A00C0E7FB /* kbmira.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = kbmira.cpp; path = ../../mert/kbmira.cpp; sourceTree = "<group>"; };
|
||||
1EC0607A1597386500614957 /* mert_lib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = mert_lib.xcodeproj; sourceTree = "<group>"; };
|
||||
1EC060A51597490800614957 /* lm.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = lm.xcodeproj; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
1E43CA3D159734A5000E29D3 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1EC060B41597490F00614957 /* liblm.a in Frameworks */,
|
||||
1EC060861597392900614957 /* libmert_lib.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
1E43CA35159734A5000E29D3 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1EC060A51597490800614957 /* lm.xcodeproj */,
|
||||
1EC0607A1597386500614957 /* mert_lib.xcodeproj */,
|
||||
1E73031D1597355A00C0E7FB /* kbmira.cpp */,
|
||||
1E43CA41159734A5000E29D3 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1E43CA41159734A5000E29D3 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1E43CA40159734A5000E29D3 /* kbmira */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1EC0607B1597386500614957 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1EC060821597386600614957 /* libmert_lib.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1EC060A61597490800614957 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1EC060B11597490800614957 /* liblm.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
1E43CA3F159734A5000E29D3 /* kbmira */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1E43CA4A159734A5000E29D3 /* Build configuration list for PBXNativeTarget "kbmira" */;
|
||||
buildPhases = (
|
||||
1E43CA3C159734A5000E29D3 /* Sources */,
|
||||
1E43CA3D159734A5000E29D3 /* Frameworks */,
|
||||
1E43CA3E159734A5000E29D3 /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
1EC060B61597491400614957 /* PBXTargetDependency */,
|
||||
1EC060851597386C00614957 /* PBXTargetDependency */,
|
||||
);
|
||||
name = kbmira;
|
||||
productName = kbmira;
|
||||
productReference = 1E43CA40159734A5000E29D3 /* kbmira */;
|
||||
productType = "com.apple.product-type.tool";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
1E43CA37159734A5000E29D3 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
buildConfigurationList = 1E43CA3A159734A5000E29D3 /* Build configuration list for PBXProject "kbmira" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 1E43CA35159734A5000E29D3;
|
||||
productRefGroup = 1E43CA41159734A5000E29D3 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectReferences = (
|
||||
{
|
||||
ProductGroup = 1EC060A61597490800614957 /* Products */;
|
||||
ProjectRef = 1EC060A51597490800614957 /* lm.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = 1EC0607B1597386500614957 /* Products */;
|
||||
ProjectRef = 1EC0607A1597386500614957 /* mert_lib.xcodeproj */;
|
||||
},
|
||||
);
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
1E43CA3F159734A5000E29D3 /* kbmira */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXReferenceProxy section */
|
||||
1EC060821597386600614957 /* libmert_lib.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libmert_lib.a;
|
||||
remoteRef = 1EC060811597386600614957 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
1EC060B11597490800614957 /* liblm.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = liblm.a;
|
||||
remoteRef = 1EC060B01597490800614957 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
/* End PBXReferenceProxy section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
1E43CA3C159734A5000E29D3 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1E73031E1597355A00C0E7FB /* kbmira.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
1EC060851597386C00614957 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = mert_lib;
|
||||
targetProxy = 1EC060841597386C00614957 /* PBXContainerItemProxy */;
|
||||
};
|
||||
1EC060B61597491400614957 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = lm;
|
||||
targetProxy = 1EC060B51597491400614957 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
1E43CA48159734A5000E29D3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
LIBRARY_SEARCH_PATHS = /opt/local/lib;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_LDFLAGS = "";
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1E43CA49159734A5000E29D3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
LIBRARY_SEARCH_PATHS = /opt/local/lib;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
OTHER_LDFLAGS = "";
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
1E43CA4B159734A5000E29D3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../..,
|
||||
/opt/local/include,
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lboost_program_options",
|
||||
"-lz",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1E43CA4C159734A5000E29D3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../..,
|
||||
/opt/local/include,
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-lboost_program_options",
|
||||
"-lz",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
1E43CA3A159734A5000E29D3 /* Build configuration list for PBXProject "kbmira" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1E43CA48159734A5000E29D3 /* Debug */,
|
||||
1E43CA49159734A5000E29D3 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
1E43CA4A159734A5000E29D3 /* Build configuration list for PBXNativeTarget "kbmira" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1E43CA4B159734A5000E29D3 /* Debug */,
|
||||
1E43CA4C159734A5000E29D3 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 1E43CA37159734A5000E29D3 /* Project object */;
|
||||
}
|
@ -39,6 +39,8 @@
|
||||
<None Include="..\..\lm\test_nounk.arpa" />
|
||||
<None Include="..\..\lm\trie.hh" />
|
||||
<None Include="..\..\lm\trie_sort.hh" />
|
||||
<None Include="..\..\lm\value.hh" />
|
||||
<None Include="..\..\lm\value_build.hh" />
|
||||
<None Include="..\..\lm\virtual_interface.hh" />
|
||||
<None Include="..\..\lm\vocab.hh" />
|
||||
<None Include="..\..\lm\weights.hh" />
|
||||
@ -82,6 +84,7 @@
|
||||
<ClCompile Include="..\..\lm\search_trie.cc" />
|
||||
<ClCompile Include="..\..\lm\trie.cc" />
|
||||
<ClCompile Include="..\..\lm\trie_sort.cc" />
|
||||
<ClCompile Include="..\..\lm\value_build.cc" />
|
||||
<ClCompile Include="..\..\lm\virtual_interface.cc" />
|
||||
<ClCompile Include="..\..\lm\vocab.cc" />
|
||||
<ClCompile Include="..\..\util\bit_packing.cc" />
|
||||
@ -127,8 +130,8 @@
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\boost\boost_1_47;$(SolutionDir)/../..</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WITH_THREADS;NO_PIPES;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\lm\msinttypes;C:\boost\boost_1_47;$(SolutionDir)/../..</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@ -143,8 +146,9 @@
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\boost\boost_1_47;$(SolutionDir)/../..</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WITH_THREADS;NO_PIPES;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\lm\msinttypes;C:\boost\boost_1_47;$(SolutionDir)/../..</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
|
@ -7,6 +7,9 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1E890C71159D1B260031F9F3 /* value_build.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1E890C6E159D1B260031F9F3 /* value_build.cc */; };
|
||||
1E890C72159D1B260031F9F3 /* value_build.hh in Headers */ = {isa = PBXBuildFile; fileRef = 1E890C6F159D1B260031F9F3 /* value_build.hh */; };
|
||||
1E890C73159D1B260031F9F3 /* value.hh in Headers */ = {isa = PBXBuildFile; fileRef = 1E890C70159D1B260031F9F3 /* value.hh */; };
|
||||
1EBA44AD14B97E22003CC0EA /* bhiksha.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1EBA442B14B97E22003CC0EA /* bhiksha.cc */; };
|
||||
1EBA44AE14B97E22003CC0EA /* bhiksha.hh in Headers */ = {isa = PBXBuildFile; fileRef = 1EBA442C14B97E22003CC0EA /* bhiksha.hh */; };
|
||||
1EBA44D414B97E22003CC0EA /* binary_format.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1EBA447D14B97E22003CC0EA /* binary_format.cc */; };
|
||||
@ -93,6 +96,9 @@
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1E890C6E159D1B260031F9F3 /* value_build.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = value_build.cc; path = ../../lm/value_build.cc; sourceTree = "<group>"; };
|
||||
1E890C6F159D1B260031F9F3 /* value_build.hh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = value_build.hh; path = ../../lm/value_build.hh; sourceTree = "<group>"; };
|
||||
1E890C70159D1B260031F9F3 /* value.hh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = value.hh; path = ../../lm/value.hh; sourceTree = "<group>"; };
|
||||
1EBA442B14B97E22003CC0EA /* bhiksha.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bhiksha.cc; path = ../../lm/bhiksha.cc; sourceTree = "<group>"; };
|
||||
1EBA442C14B97E22003CC0EA /* bhiksha.hh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = bhiksha.hh; path = ../../lm/bhiksha.hh; sourceTree = "<group>"; };
|
||||
1EBA447D14B97E22003CC0EA /* binary_format.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = binary_format.cc; path = ../../lm/binary_format.cc; sourceTree = "<group>"; };
|
||||
@ -196,6 +202,9 @@
|
||||
1EBA44FB14B97E6A003CC0EA /* lm */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1E890C6E159D1B260031F9F3 /* value_build.cc */,
|
||||
1E890C6F159D1B260031F9F3 /* value_build.hh */,
|
||||
1E890C70159D1B260031F9F3 /* value.hh */,
|
||||
1EBA442B14B97E22003CC0EA /* bhiksha.cc */,
|
||||
1EBA442C14B97E22003CC0EA /* bhiksha.hh */,
|
||||
1EBA447D14B97E22003CC0EA /* binary_format.cc */,
|
||||
@ -366,6 +375,8 @@
|
||||
1EBA459E14B97E92003CC0EA /* sorted_uniform.hh in Headers */,
|
||||
1EBA459F14B97E92003CC0EA /* string_piece.hh in Headers */,
|
||||
1EBA45A114B97E92003CC0EA /* tokenize_piece.hh in Headers */,
|
||||
1E890C72159D1B260031F9F3 /* value_build.hh in Headers */,
|
||||
1E890C73159D1B260031F9F3 /* value.hh in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -464,6 +475,7 @@
|
||||
1EBA459814B97E92003CC0EA /* probing_hash_table_test.cc in Sources */,
|
||||
1EBA459D14B97E92003CC0EA /* sorted_uniform_test.cc in Sources */,
|
||||
1EBA45A014B97E92003CC0EA /* tokenize_piece_test.cc in Sources */,
|
||||
1E890C71159D1B260031F9F3 /* value_build.cc in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "1EE8C2E81476A48E002496F2"
|
||||
BuildableName = "liblm.a"
|
||||
BlueprintName = "lm"
|
||||
ReferencedContainer = "container:lm.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug">
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release">
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>lm.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>1EE8C2E81476A48E002496F2</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
337
contrib/other-builds/mert.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,337 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1E1D826915AC641600FE42E9 /* extractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E1D825915AC63ED00FE42E9 /* extractor.cpp */; };
|
||||
1E1D826A15AC642B00FE42E9 /* libmert_lib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E2B6B141593A6F30028137E /* libmert_lib.a */; };
|
||||
1E2B6ADE1593A5500028137E /* mert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2B6ADD1593A5500028137E /* mert.cpp */; };
|
||||
1E2B6B1F1593CA8A0028137E /* libmert_lib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E2B6B141593A6F30028137E /* libmert_lib.a */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
1E2B6B131593A6F30028137E /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 1E2B6B0F1593A6F30028137E /* mert_lib.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 1E2CCF3315939E2D00D858D1;
|
||||
remoteInfo = mert_lib;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
1E1D825D15AC640800FE42E9 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = /usr/share/man/man1/;
|
||||
dstSubfolderSpec = 0;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 1;
|
||||
};
|
||||
1EB0AF031593A2180007E2A4 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = /usr/share/man/man1/;
|
||||
dstSubfolderSpec = 0;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 1;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1E1D825915AC63ED00FE42E9 /* extractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = extractor.cpp; path = ../../mert/extractor.cpp; sourceTree = "<group>"; };
|
||||
1E1D825F15AC640800FE42E9 /* extractor */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = extractor; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
1E2B6ADD1593A5500028137E /* mert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mert.cpp; path = ../../mert/mert.cpp; sourceTree = "<group>"; };
|
||||
1E2B6B0F1593A6F30028137E /* mert_lib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = mert_lib.xcodeproj; sourceTree = "<group>"; };
|
||||
1EB0AF051593A2180007E2A4 /* mert */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mert; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
1E1D825C15AC640800FE42E9 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1E1D826A15AC642B00FE42E9 /* libmert_lib.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
1EB0AF021593A2180007E2A4 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1E2B6B1F1593CA8A0028137E /* libmert_lib.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
1E2B6B101593A6F30028137E /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1E2B6B141593A6F30028137E /* libmert_lib.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1EB0AEFA1593A2180007E2A4 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1E2B6B0F1593A6F30028137E /* mert_lib.xcodeproj */,
|
||||
1E2B6ADD1593A5500028137E /* mert.cpp */,
|
||||
1E1D825915AC63ED00FE42E9 /* extractor.cpp */,
|
||||
1EB0AF061593A2180007E2A4 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1EB0AF061593A2180007E2A4 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1EB0AF051593A2180007E2A4 /* mert */,
|
||||
1E1D825F15AC640800FE42E9 /* extractor */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
1E1D825E15AC640800FE42E9 /* extractor */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1E1D826615AC640800FE42E9 /* Build configuration list for PBXNativeTarget "extractor" */;
|
||||
buildPhases = (
|
||||
1E1D825B15AC640800FE42E9 /* Sources */,
|
||||
1E1D825C15AC640800FE42E9 /* Frameworks */,
|
||||
1E1D825D15AC640800FE42E9 /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = extractor;
|
||||
productName = extractor;
|
||||
productReference = 1E1D825F15AC640800FE42E9 /* extractor */;
|
||||
productType = "com.apple.product-type.tool";
|
||||
};
|
||||
1EB0AF041593A2180007E2A4 /* mert */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1EB0AF0F1593A2180007E2A4 /* Build configuration list for PBXNativeTarget "mert" */;
|
||||
buildPhases = (
|
||||
1EB0AF011593A2180007E2A4 /* Sources */,
|
||||
1EB0AF021593A2180007E2A4 /* Frameworks */,
|
||||
1EB0AF031593A2180007E2A4 /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = mert;
|
||||
productName = mert;
|
||||
productReference = 1EB0AF051593A2180007E2A4 /* mert */;
|
||||
productType = "com.apple.product-type.tool";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
1EB0AEFC1593A2180007E2A4 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
buildConfigurationList = 1EB0AEFF1593A2180007E2A4 /* Build configuration list for PBXProject "mert" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 1EB0AEFA1593A2180007E2A4;
|
||||
productRefGroup = 1EB0AF061593A2180007E2A4 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectReferences = (
|
||||
{
|
||||
ProductGroup = 1E2B6B101593A6F30028137E /* Products */;
|
||||
ProjectRef = 1E2B6B0F1593A6F30028137E /* mert_lib.xcodeproj */;
|
||||
},
|
||||
);
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
1EB0AF041593A2180007E2A4 /* mert */,
|
||||
1E1D825E15AC640800FE42E9 /* extractor */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXReferenceProxy section */
|
||||
1E2B6B141593A6F30028137E /* libmert_lib.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libmert_lib.a;
|
||||
remoteRef = 1E2B6B131593A6F30028137E /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
/* End PBXReferenceProxy section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
1E1D825B15AC640800FE42E9 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1E1D826915AC641600FE42E9 /* extractor.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
1EB0AF011593A2180007E2A4 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1E2B6ADE1593A5500028137E /* mert.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
1E1D826715AC640800FE42E9 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../..,
|
||||
/opt/local/include,
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1E1D826815AC640800FE42E9 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../..,
|
||||
/opt/local/include,
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
1EB0AF0D1593A2180007E2A4 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_LDFLAGS = "-lz";
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1EB0AF0E1593A2180007E2A4 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
OTHER_LDFLAGS = "-lz";
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
1EB0AF101593A2180007E2A4 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
WITH_THREADS,
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../..,
|
||||
/opt/local/include,
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = /opt/local/lib/;
|
||||
OTHER_LDFLAGS = (
|
||||
"-lz",
|
||||
"-lboost_thread-mt",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1EB0AF111593A2180007E2A4 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_PREPROCESSOR_DEFINITIONS = WITH_THREADS;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../..,
|
||||
/opt/local/include,
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = /opt/local/lib/;
|
||||
OTHER_LDFLAGS = (
|
||||
"-lz",
|
||||
"-lboost_thread-mt",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
1E1D826615AC640800FE42E9 /* Build configuration list for PBXNativeTarget "extractor" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1E1D826715AC640800FE42E9 /* Debug */,
|
||||
1E1D826815AC640800FE42E9 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
};
|
||||
1EB0AEFF1593A2180007E2A4 /* Build configuration list for PBXProject "mert" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1EB0AF0D1593A2180007E2A4 /* Debug */,
|
||||
1EB0AF0E1593A2180007E2A4 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
1EB0AF0F1593A2180007E2A4 /* Build configuration list for PBXNativeTarget "mert" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1EB0AF101593A2180007E2A4 /* Debug */,
|
||||
1EB0AF111593A2180007E2A4 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 1EB0AEFC1593A2180007E2A4 /* Project object */;
|
||||
}
|
621
contrib/other-builds/mert_lib.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,621 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1E2CCFB915939E5D00D858D1 /* BleuScorer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF3A15939E5D00D858D1 /* BleuScorer.cpp */; };
|
||||
1E2CCFBA15939E5D00D858D1 /* BleuScorer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF3B15939E5D00D858D1 /* BleuScorer.h */; };
|
||||
1E2CCFBC15939E5D00D858D1 /* CderScorer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF3D15939E5D00D858D1 /* CderScorer.cpp */; };
|
||||
1E2CCFBD15939E5D00D858D1 /* CderScorer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF3E15939E5D00D858D1 /* CderScorer.h */; };
|
||||
1E2CCFBE15939E5D00D858D1 /* Data.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF3F15939E5D00D858D1 /* Data.cpp */; };
|
||||
1E2CCFBF15939E5D00D858D1 /* Data.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF4015939E5D00D858D1 /* Data.h */; };
|
||||
1E2CCFC315939E5D00D858D1 /* Fdstream.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF5115939E5D00D858D1 /* Fdstream.h */; };
|
||||
1E2CCFC415939E5D00D858D1 /* FeatureArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF5215939E5D00D858D1 /* FeatureArray.cpp */; };
|
||||
1E2CCFC515939E5D00D858D1 /* FeatureArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF5315939E5D00D858D1 /* FeatureArray.h */; };
|
||||
1E2CCFC615939E5D00D858D1 /* FeatureData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF5415939E5D00D858D1 /* FeatureData.cpp */; };
|
||||
1E2CCFC715939E5D00D858D1 /* FeatureData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF5515939E5D00D858D1 /* FeatureData.h */; };
|
||||
1E2CCFC815939E5D00D858D1 /* FeatureDataIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF5615939E5D00D858D1 /* FeatureDataIterator.cpp */; };
|
||||
1E2CCFC915939E5D00D858D1 /* FeatureDataIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF5715939E5D00D858D1 /* FeatureDataIterator.h */; };
|
||||
1E2CCFCB15939E5D00D858D1 /* FeatureStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF5915939E5D00D858D1 /* FeatureStats.cpp */; };
|
||||
1E2CCFCC15939E5D00D858D1 /* FeatureStats.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF5A15939E5D00D858D1 /* FeatureStats.h */; };
|
||||
1E2CCFCD15939E5D00D858D1 /* FileStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF5B15939E5D00D858D1 /* FileStream.cpp */; };
|
||||
1E2CCFCE15939E5D00D858D1 /* FileStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF5C15939E5D00D858D1 /* FileStream.h */; };
|
||||
1E2CCFCF15939E5D00D858D1 /* GzFileBuf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF5D15939E5D00D858D1 /* GzFileBuf.cpp */; };
|
||||
1E2CCFD015939E5D00D858D1 /* GzFileBuf.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF5E15939E5D00D858D1 /* GzFileBuf.h */; };
|
||||
1E2CCFD115939E5D00D858D1 /* HypPackEnumerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF5F15939E5D00D858D1 /* HypPackEnumerator.cpp */; };
|
||||
1E2CCFD215939E5D00D858D1 /* HypPackEnumerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF6015939E5D00D858D1 /* HypPackEnumerator.h */; };
|
||||
1E2CCFD315939E5D00D858D1 /* InterpolatedScorer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF6115939E5D00D858D1 /* InterpolatedScorer.cpp */; };
|
||||
1E2CCFD415939E5D00D858D1 /* InterpolatedScorer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF6215939E5D00D858D1 /* InterpolatedScorer.h */; };
|
||||
1E2CCFD715939E5D00D858D1 /* MergeScorer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF6515939E5D00D858D1 /* MergeScorer.cpp */; };
|
||||
1E2CCFD815939E5D00D858D1 /* MergeScorer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF6615939E5D00D858D1 /* MergeScorer.h */; };
|
||||
1E2CCFD915939E5D00D858D1 /* mert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF6715939E5D00D858D1 /* mert.cpp */; };
|
||||
1E2CCFDA15939E5D00D858D1 /* MiraFeatureVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF6815939E5D00D858D1 /* MiraFeatureVector.cpp */; };
|
||||
1E2CCFDB15939E5D00D858D1 /* MiraFeatureVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF6915939E5D00D858D1 /* MiraFeatureVector.h */; };
|
||||
1E2CCFDC15939E5D00D858D1 /* MiraWeightVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF6A15939E5D00D858D1 /* MiraWeightVector.cpp */; };
|
||||
1E2CCFDD15939E5D00D858D1 /* MiraWeightVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF6B15939E5D00D858D1 /* MiraWeightVector.h */; };
|
||||
1E2CCFDE15939E5D00D858D1 /* Ngram.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF6C15939E5D00D858D1 /* Ngram.h */; };
|
||||
1E2CCFE015939E5D00D858D1 /* Optimizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF6E15939E5D00D858D1 /* Optimizer.cpp */; };
|
||||
1E2CCFE115939E5D00D858D1 /* Optimizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF6F15939E5D00D858D1 /* Optimizer.h */; };
|
||||
1E2CCFE215939E5D00D858D1 /* OptimizerFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF7015939E5D00D858D1 /* OptimizerFactory.cpp */; };
|
||||
1E2CCFE315939E5D00D858D1 /* OptimizerFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF7115939E5D00D858D1 /* OptimizerFactory.h */; };
|
||||
1E2CCFE515939E5D00D858D1 /* PerScorer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF7315939E5D00D858D1 /* PerScorer.cpp */; };
|
||||
1E2CCFE615939E5D00D858D1 /* PerScorer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF7415939E5D00D858D1 /* PerScorer.h */; };
|
||||
1E2CCFE715939E5D00D858D1 /* Point.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF7515939E5D00D858D1 /* Point.cpp */; };
|
||||
1E2CCFE815939E5D00D858D1 /* Point.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF7615939E5D00D858D1 /* Point.h */; };
|
||||
1E2CCFEA15939E5D00D858D1 /* PreProcessFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF7815939E5D00D858D1 /* PreProcessFilter.cpp */; };
|
||||
1E2CCFEB15939E5D00D858D1 /* PreProcessFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF7915939E5D00D858D1 /* PreProcessFilter.h */; };
|
||||
1E2CCFED15939E5D00D858D1 /* Reference.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF7B15939E5D00D858D1 /* Reference.h */; };
|
||||
1E2CCFEF15939E5D00D858D1 /* ScopedVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF7D15939E5D00D858D1 /* ScopedVector.h */; };
|
||||
1E2CCFF015939E5D00D858D1 /* ScoreArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF7E15939E5D00D858D1 /* ScoreArray.cpp */; };
|
||||
1E2CCFF115939E5D00D858D1 /* ScoreArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF7F15939E5D00D858D1 /* ScoreArray.h */; };
|
||||
1E2CCFF215939E5D00D858D1 /* ScoreData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF8015939E5D00D858D1 /* ScoreData.cpp */; };
|
||||
1E2CCFF315939E5D00D858D1 /* ScoreData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF8115939E5D00D858D1 /* ScoreData.h */; };
|
||||
1E2CCFF415939E5D00D858D1 /* ScoreDataIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF8215939E5D00D858D1 /* ScoreDataIterator.cpp */; };
|
||||
1E2CCFF515939E5D00D858D1 /* ScoreDataIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF8315939E5D00D858D1 /* ScoreDataIterator.h */; };
|
||||
1E2CCFF615939E5D00D858D1 /* Scorer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF8415939E5D00D858D1 /* Scorer.cpp */; };
|
||||
1E2CCFF715939E5D00D858D1 /* Scorer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF8515939E5D00D858D1 /* Scorer.h */; };
|
||||
1E2CCFF815939E5D00D858D1 /* ScorerFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF8615939E5D00D858D1 /* ScorerFactory.cpp */; };
|
||||
1E2CCFF915939E5D00D858D1 /* ScorerFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF8715939E5D00D858D1 /* ScorerFactory.h */; };
|
||||
1E2CCFFA15939E5D00D858D1 /* ScoreStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF8815939E5D00D858D1 /* ScoreStats.cpp */; };
|
||||
1E2CCFFB15939E5D00D858D1 /* ScoreStats.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF8915939E5D00D858D1 /* ScoreStats.h */; };
|
||||
1E2CCFFC15939E5D00D858D1 /* SemposOverlapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF8A15939E5D00D858D1 /* SemposOverlapping.cpp */; };
|
||||
1E2CCFFD15939E5D00D858D1 /* SemposOverlapping.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF8B15939E5D00D858D1 /* SemposOverlapping.h */; };
|
||||
1E2CCFFE15939E5D00D858D1 /* SemposScorer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF8C15939E5D00D858D1 /* SemposScorer.cpp */; };
|
||||
1E2CCFFF15939E5D00D858D1 /* SemposScorer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF8D15939E5D00D858D1 /* SemposScorer.h */; };
|
||||
1E2CD00015939E5D00D858D1 /* Singleton.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF8E15939E5D00D858D1 /* Singleton.h */; };
|
||||
1E2CD00215939E5D00D858D1 /* alignmentStruct.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF9115939E5D00D858D1 /* alignmentStruct.cpp */; };
|
||||
1E2CD00315939E5D00D858D1 /* alignmentStruct.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF9215939E5D00D858D1 /* alignmentStruct.h */; };
|
||||
1E2CD00415939E5D00D858D1 /* bestShiftStruct.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF9315939E5D00D858D1 /* bestShiftStruct.h */; };
|
||||
1E2CD00515939E5D00D858D1 /* hashMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF9415939E5D00D858D1 /* hashMap.cpp */; };
|
||||
1E2CD00615939E5D00D858D1 /* hashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF9515939E5D00D858D1 /* hashMap.h */; };
|
||||
1E2CD00715939E5D00D858D1 /* hashMapInfos.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF9615939E5D00D858D1 /* hashMapInfos.cpp */; };
|
||||
1E2CD00815939E5D00D858D1 /* hashMapInfos.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF9715939E5D00D858D1 /* hashMapInfos.h */; };
|
||||
1E2CD00915939E5D00D858D1 /* hashMapStringInfos.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF9815939E5D00D858D1 /* hashMapStringInfos.cpp */; };
|
||||
1E2CD00A15939E5D00D858D1 /* hashMapStringInfos.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF9915939E5D00D858D1 /* hashMapStringInfos.h */; };
|
||||
1E2CD00B15939E5D00D858D1 /* infosHasher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF9A15939E5D00D858D1 /* infosHasher.cpp */; };
|
||||
1E2CD00C15939E5D00D858D1 /* infosHasher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF9B15939E5D00D858D1 /* infosHasher.h */; };
|
||||
1E2CD00D15939E5D00D858D1 /* stringHasher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF9C15939E5D00D858D1 /* stringHasher.cpp */; };
|
||||
1E2CD00E15939E5D00D858D1 /* stringHasher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF9D15939E5D00D858D1 /* stringHasher.h */; };
|
||||
1E2CD00F15939E5D00D858D1 /* stringInfosHasher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCF9E15939E5D00D858D1 /* stringInfosHasher.cpp */; };
|
||||
1E2CD01015939E5D00D858D1 /* stringInfosHasher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCF9F15939E5D00D858D1 /* stringInfosHasher.h */; };
|
||||
1E2CD01115939E5D00D858D1 /* terAlignment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCFA015939E5D00D858D1 /* terAlignment.cpp */; };
|
||||
1E2CD01215939E5D00D858D1 /* terAlignment.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCFA115939E5D00D858D1 /* terAlignment.h */; };
|
||||
1E2CD01315939E5D00D858D1 /* tercalc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCFA215939E5D00D858D1 /* tercalc.cpp */; };
|
||||
1E2CD01415939E5D00D858D1 /* tercalc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCFA315939E5D00D858D1 /* tercalc.h */; };
|
||||
1E2CD01515939E5D00D858D1 /* terShift.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCFA415939E5D00D858D1 /* terShift.cpp */; };
|
||||
1E2CD01615939E5D00D858D1 /* terShift.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCFA515939E5D00D858D1 /* terShift.h */; };
|
||||
1E2CD01715939E5D00D858D1 /* tools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCFA615939E5D00D858D1 /* tools.cpp */; };
|
||||
1E2CD01815939E5D00D858D1 /* tools.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCFA715939E5D00D858D1 /* tools.h */; };
|
||||
1E2CD01915939E5D00D858D1 /* TerScorer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCFA815939E5D00D858D1 /* TerScorer.cpp */; };
|
||||
1E2CD01A15939E5D00D858D1 /* TerScorer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCFA915939E5D00D858D1 /* TerScorer.h */; };
|
||||
1E2CD01C15939E5D00D858D1 /* Timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCFAE15939E5D00D858D1 /* Timer.cpp */; };
|
||||
1E2CD01D15939E5D00D858D1 /* Timer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCFAF15939E5D00D858D1 /* Timer.h */; };
|
||||
1E2CD01F15939E5D00D858D1 /* Types.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCFB215939E5D00D858D1 /* Types.h */; };
|
||||
1E2CD02015939E5D00D858D1 /* Util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCFB315939E5D00D858D1 /* Util.cpp */; };
|
||||
1E2CD02115939E5D00D858D1 /* Util.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCFB415939E5D00D858D1 /* Util.h */; };
|
||||
1E2CD02315939E5D00D858D1 /* Vocabulary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E2CCFB615939E5D00D858D1 /* Vocabulary.cpp */; };
|
||||
1E2CD02415939E5D00D858D1 /* Vocabulary.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E2CCFB715939E5D00D858D1 /* Vocabulary.h */; };
|
||||
1E39621B1594CFD1006FE978 /* PermutationScorer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E3962191594CFD1006FE978 /* PermutationScorer.cpp */; };
|
||||
1E3962201594CFF9006FE978 /* Permutation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E39621E1594CFF9006FE978 /* Permutation.cpp */; };
|
||||
1E3962211594CFF9006FE978 /* Permutation.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E39621F1594CFF9006FE978 /* Permutation.h */; };
|
||||
1E3962231594D0FF006FE978 /* SentenceLevelScorer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E3962221594D0FF006FE978 /* SentenceLevelScorer.cpp */; };
|
||||
1E3962251594D12C006FE978 /* SentenceLevelScorer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E3962241594D12C006FE978 /* SentenceLevelScorer.h */; };
|
||||
1E43CA3415973474000E29D3 /* PermutationScorer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E43CA3315973474000E29D3 /* PermutationScorer.h */; };
|
||||
1E689F21159A529C00DD995A /* ThreadPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E689F1F159A529C00DD995A /* ThreadPool.cpp */; };
|
||||
1E689F22159A529C00DD995A /* ThreadPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E689F20159A529C00DD995A /* ThreadPool.h */; };
|
||||
1EE52B561596B3E4006DC938 /* StatisticsBasedScorer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EE52B551596B3E4006DC938 /* StatisticsBasedScorer.h */; };
|
||||
1EE52B591596B3FC006DC938 /* StatisticsBasedScorer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1EE52B581596B3FC006DC938 /* StatisticsBasedScorer.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1E2CCF3315939E2D00D858D1 /* libmert_lib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libmert_lib.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
1E2CCF3A15939E5D00D858D1 /* BleuScorer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BleuScorer.cpp; path = ../../mert/BleuScorer.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF3B15939E5D00D858D1 /* BleuScorer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BleuScorer.h; path = ../../mert/BleuScorer.h; sourceTree = "<group>"; };
|
||||
1E2CCF3D15939E5D00D858D1 /* CderScorer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CderScorer.cpp; path = ../../mert/CderScorer.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF3E15939E5D00D858D1 /* CderScorer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CderScorer.h; path = ../../mert/CderScorer.h; sourceTree = "<group>"; };
|
||||
1E2CCF3F15939E5D00D858D1 /* Data.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Data.cpp; path = ../../mert/Data.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF4015939E5D00D858D1 /* Data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Data.h; path = ../../mert/Data.h; sourceTree = "<group>"; };
|
||||
1E2CCF5115939E5D00D858D1 /* Fdstream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Fdstream.h; path = ../../mert/Fdstream.h; sourceTree = "<group>"; };
|
||||
1E2CCF5215939E5D00D858D1 /* FeatureArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FeatureArray.cpp; path = ../../mert/FeatureArray.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF5315939E5D00D858D1 /* FeatureArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FeatureArray.h; path = ../../mert/FeatureArray.h; sourceTree = "<group>"; };
|
||||
1E2CCF5415939E5D00D858D1 /* FeatureData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FeatureData.cpp; path = ../../mert/FeatureData.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF5515939E5D00D858D1 /* FeatureData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FeatureData.h; path = ../../mert/FeatureData.h; sourceTree = "<group>"; };
|
||||
1E2CCF5615939E5D00D858D1 /* FeatureDataIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FeatureDataIterator.cpp; path = ../../mert/FeatureDataIterator.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF5715939E5D00D858D1 /* FeatureDataIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FeatureDataIterator.h; path = ../../mert/FeatureDataIterator.h; sourceTree = "<group>"; };
|
||||
1E2CCF5915939E5D00D858D1 /* FeatureStats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FeatureStats.cpp; path = ../../mert/FeatureStats.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF5A15939E5D00D858D1 /* FeatureStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FeatureStats.h; path = ../../mert/FeatureStats.h; sourceTree = "<group>"; };
|
||||
1E2CCF5B15939E5D00D858D1 /* FileStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileStream.cpp; path = ../../mert/FileStream.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF5C15939E5D00D858D1 /* FileStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileStream.h; path = ../../mert/FileStream.h; sourceTree = "<group>"; };
|
||||
1E2CCF5D15939E5D00D858D1 /* GzFileBuf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GzFileBuf.cpp; path = ../../mert/GzFileBuf.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF5E15939E5D00D858D1 /* GzFileBuf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GzFileBuf.h; path = ../../mert/GzFileBuf.h; sourceTree = "<group>"; };
|
||||
1E2CCF5F15939E5D00D858D1 /* HypPackEnumerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HypPackEnumerator.cpp; path = ../../mert/HypPackEnumerator.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF6015939E5D00D858D1 /* HypPackEnumerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HypPackEnumerator.h; path = ../../mert/HypPackEnumerator.h; sourceTree = "<group>"; };
|
||||
1E2CCF6115939E5D00D858D1 /* InterpolatedScorer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InterpolatedScorer.cpp; path = ../../mert/InterpolatedScorer.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF6215939E5D00D858D1 /* InterpolatedScorer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InterpolatedScorer.h; path = ../../mert/InterpolatedScorer.h; sourceTree = "<group>"; };
|
||||
1E2CCF6515939E5D00D858D1 /* MergeScorer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MergeScorer.cpp; path = ../../mert/MergeScorer.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF6615939E5D00D858D1 /* MergeScorer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MergeScorer.h; path = ../../mert/MergeScorer.h; sourceTree = "<group>"; };
|
||||
1E2CCF6715939E5D00D858D1 /* mert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mert.cpp; path = ../../mert/mert.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF6815939E5D00D858D1 /* MiraFeatureVector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MiraFeatureVector.cpp; path = ../../mert/MiraFeatureVector.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF6915939E5D00D858D1 /* MiraFeatureVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MiraFeatureVector.h; path = ../../mert/MiraFeatureVector.h; sourceTree = "<group>"; };
|
||||
1E2CCF6A15939E5D00D858D1 /* MiraWeightVector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MiraWeightVector.cpp; path = ../../mert/MiraWeightVector.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF6B15939E5D00D858D1 /* MiraWeightVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MiraWeightVector.h; path = ../../mert/MiraWeightVector.h; sourceTree = "<group>"; };
|
||||
1E2CCF6C15939E5D00D858D1 /* Ngram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Ngram.h; path = ../../mert/Ngram.h; sourceTree = "<group>"; };
|
||||
1E2CCF6E15939E5D00D858D1 /* Optimizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Optimizer.cpp; path = ../../mert/Optimizer.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF6F15939E5D00D858D1 /* Optimizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Optimizer.h; path = ../../mert/Optimizer.h; sourceTree = "<group>"; };
|
||||
1E2CCF7015939E5D00D858D1 /* OptimizerFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptimizerFactory.cpp; path = ../../mert/OptimizerFactory.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF7115939E5D00D858D1 /* OptimizerFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptimizerFactory.h; path = ../../mert/OptimizerFactory.h; sourceTree = "<group>"; };
|
||||
1E2CCF7315939E5D00D858D1 /* PerScorer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PerScorer.cpp; path = ../../mert/PerScorer.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF7415939E5D00D858D1 /* PerScorer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PerScorer.h; path = ../../mert/PerScorer.h; sourceTree = "<group>"; };
|
||||
1E2CCF7515939E5D00D858D1 /* Point.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Point.cpp; path = ../../mert/Point.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF7615939E5D00D858D1 /* Point.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Point.h; path = ../../mert/Point.h; sourceTree = "<group>"; };
|
||||
1E2CCF7815939E5D00D858D1 /* PreProcessFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PreProcessFilter.cpp; path = ../../mert/PreProcessFilter.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF7915939E5D00D858D1 /* PreProcessFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PreProcessFilter.h; path = ../../mert/PreProcessFilter.h; sourceTree = "<group>"; };
|
||||
1E2CCF7B15939E5D00D858D1 /* Reference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Reference.h; path = ../../mert/Reference.h; sourceTree = "<group>"; };
|
||||
1E2CCF7D15939E5D00D858D1 /* ScopedVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScopedVector.h; path = ../../mert/ScopedVector.h; sourceTree = "<group>"; };
|
||||
1E2CCF7E15939E5D00D858D1 /* ScoreArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScoreArray.cpp; path = ../../mert/ScoreArray.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF7F15939E5D00D858D1 /* ScoreArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScoreArray.h; path = ../../mert/ScoreArray.h; sourceTree = "<group>"; };
|
||||
1E2CCF8015939E5D00D858D1 /* ScoreData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScoreData.cpp; path = ../../mert/ScoreData.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF8115939E5D00D858D1 /* ScoreData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScoreData.h; path = ../../mert/ScoreData.h; sourceTree = "<group>"; };
|
||||
1E2CCF8215939E5D00D858D1 /* ScoreDataIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScoreDataIterator.cpp; path = ../../mert/ScoreDataIterator.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF8315939E5D00D858D1 /* ScoreDataIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScoreDataIterator.h; path = ../../mert/ScoreDataIterator.h; sourceTree = "<group>"; };
|
||||
1E2CCF8415939E5D00D858D1 /* Scorer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Scorer.cpp; path = ../../mert/Scorer.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF8515939E5D00D858D1 /* Scorer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Scorer.h; path = ../../mert/Scorer.h; sourceTree = "<group>"; };
|
||||
1E2CCF8615939E5D00D858D1 /* ScorerFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScorerFactory.cpp; path = ../../mert/ScorerFactory.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF8715939E5D00D858D1 /* ScorerFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScorerFactory.h; path = ../../mert/ScorerFactory.h; sourceTree = "<group>"; };
|
||||
1E2CCF8815939E5D00D858D1 /* ScoreStats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScoreStats.cpp; path = ../../mert/ScoreStats.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF8915939E5D00D858D1 /* ScoreStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScoreStats.h; path = ../../mert/ScoreStats.h; sourceTree = "<group>"; };
|
||||
1E2CCF8A15939E5D00D858D1 /* SemposOverlapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SemposOverlapping.cpp; path = ../../mert/SemposOverlapping.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF8B15939E5D00D858D1 /* SemposOverlapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SemposOverlapping.h; path = ../../mert/SemposOverlapping.h; sourceTree = "<group>"; };
|
||||
1E2CCF8C15939E5D00D858D1 /* SemposScorer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SemposScorer.cpp; path = ../../mert/SemposScorer.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF8D15939E5D00D858D1 /* SemposScorer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SemposScorer.h; path = ../../mert/SemposScorer.h; sourceTree = "<group>"; };
|
||||
1E2CCF8E15939E5D00D858D1 /* Singleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Singleton.h; path = ../../mert/Singleton.h; sourceTree = "<group>"; };
|
||||
1E2CCF9115939E5D00D858D1 /* alignmentStruct.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = alignmentStruct.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF9215939E5D00D858D1 /* alignmentStruct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = alignmentStruct.h; sourceTree = "<group>"; };
|
||||
1E2CCF9315939E5D00D858D1 /* bestShiftStruct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bestShiftStruct.h; sourceTree = "<group>"; };
|
||||
1E2CCF9415939E5D00D858D1 /* hashMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hashMap.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF9515939E5D00D858D1 /* hashMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hashMap.h; sourceTree = "<group>"; };
|
||||
1E2CCF9615939E5D00D858D1 /* hashMapInfos.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hashMapInfos.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF9715939E5D00D858D1 /* hashMapInfos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hashMapInfos.h; sourceTree = "<group>"; };
|
||||
1E2CCF9815939E5D00D858D1 /* hashMapStringInfos.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hashMapStringInfos.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF9915939E5D00D858D1 /* hashMapStringInfos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hashMapStringInfos.h; sourceTree = "<group>"; };
|
||||
1E2CCF9A15939E5D00D858D1 /* infosHasher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = infosHasher.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF9B15939E5D00D858D1 /* infosHasher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = infosHasher.h; sourceTree = "<group>"; };
|
||||
1E2CCF9C15939E5D00D858D1 /* stringHasher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stringHasher.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF9D15939E5D00D858D1 /* stringHasher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stringHasher.h; sourceTree = "<group>"; };
|
||||
1E2CCF9E15939E5D00D858D1 /* stringInfosHasher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stringInfosHasher.cpp; sourceTree = "<group>"; };
|
||||
1E2CCF9F15939E5D00D858D1 /* stringInfosHasher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stringInfosHasher.h; sourceTree = "<group>"; };
|
||||
1E2CCFA015939E5D00D858D1 /* terAlignment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = terAlignment.cpp; sourceTree = "<group>"; };
|
||||
1E2CCFA115939E5D00D858D1 /* terAlignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = terAlignment.h; sourceTree = "<group>"; };
|
||||
1E2CCFA215939E5D00D858D1 /* tercalc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tercalc.cpp; sourceTree = "<group>"; };
|
||||
1E2CCFA315939E5D00D858D1 /* tercalc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tercalc.h; sourceTree = "<group>"; };
|
||||
1E2CCFA415939E5D00D858D1 /* terShift.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = terShift.cpp; sourceTree = "<group>"; };
|
||||
1E2CCFA515939E5D00D858D1 /* terShift.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = terShift.h; sourceTree = "<group>"; };
|
||||
1E2CCFA615939E5D00D858D1 /* tools.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tools.cpp; sourceTree = "<group>"; };
|
||||
1E2CCFA715939E5D00D858D1 /* tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tools.h; sourceTree = "<group>"; };
|
||||
1E2CCFA815939E5D00D858D1 /* TerScorer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TerScorer.cpp; path = ../../mert/TerScorer.cpp; sourceTree = "<group>"; };
|
||||
1E2CCFA915939E5D00D858D1 /* TerScorer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TerScorer.h; path = ../../mert/TerScorer.h; sourceTree = "<group>"; };
|
||||
1E2CCFAE15939E5D00D858D1 /* Timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Timer.cpp; path = ../../mert/Timer.cpp; sourceTree = "<group>"; };
|
||||
1E2CCFAF15939E5D00D858D1 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Timer.h; path = ../../mert/Timer.h; sourceTree = "<group>"; };
|
||||
1E2CCFB215939E5D00D858D1 /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Types.h; path = ../../mert/Types.h; sourceTree = "<group>"; };
|
||||
1E2CCFB315939E5D00D858D1 /* Util.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Util.cpp; path = ../../mert/Util.cpp; sourceTree = "<group>"; };
|
||||
1E2CCFB415939E5D00D858D1 /* Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Util.h; path = ../../mert/Util.h; sourceTree = "<group>"; };
|
||||
1E2CCFB615939E5D00D858D1 /* Vocabulary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Vocabulary.cpp; path = ../../mert/Vocabulary.cpp; sourceTree = "<group>"; };
|
||||
1E2CCFB715939E5D00D858D1 /* Vocabulary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Vocabulary.h; path = ../../mert/Vocabulary.h; sourceTree = "<group>"; };
|
||||
1E3962191594CFD1006FE978 /* PermutationScorer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PermutationScorer.cpp; path = ../../mert/PermutationScorer.cpp; sourceTree = "<group>"; };
|
||||
1E39621E1594CFF9006FE978 /* Permutation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Permutation.cpp; path = ../../mert/Permutation.cpp; sourceTree = "<group>"; };
|
||||
1E39621F1594CFF9006FE978 /* Permutation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Permutation.h; path = ../../mert/Permutation.h; sourceTree = "<group>"; };
|
||||
1E3962221594D0FF006FE978 /* SentenceLevelScorer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SentenceLevelScorer.cpp; path = ../../mert/SentenceLevelScorer.cpp; sourceTree = "<group>"; };
|
||||
1E3962241594D12C006FE978 /* SentenceLevelScorer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentenceLevelScorer.h; path = ../../mert/SentenceLevelScorer.h; sourceTree = "<group>"; };
|
||||
1E43CA3315973474000E29D3 /* PermutationScorer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PermutationScorer.h; path = ../../mert/PermutationScorer.h; sourceTree = "<group>"; };
|
||||
1E689F1F159A529C00DD995A /* ThreadPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPool.cpp; path = ../../moses/src/ThreadPool.cpp; sourceTree = "<group>"; };
|
||||
1E689F20159A529C00DD995A /* ThreadPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPool.h; path = ../../moses/src/ThreadPool.h; sourceTree = "<group>"; };
|
||||
1EE52B551596B3E4006DC938 /* StatisticsBasedScorer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StatisticsBasedScorer.h; path = ../../mert/StatisticsBasedScorer.h; sourceTree = "<group>"; };
|
||||
1EE52B581596B3FC006DC938 /* StatisticsBasedScorer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StatisticsBasedScorer.cpp; path = ../../mert/StatisticsBasedScorer.cpp; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
1E2CCF3015939E2D00D858D1 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
1E2CCF2815939E2D00D858D1 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1E689F1F159A529C00DD995A /* ThreadPool.cpp */,
|
||||
1E689F20159A529C00DD995A /* ThreadPool.h */,
|
||||
1EE52B581596B3FC006DC938 /* StatisticsBasedScorer.cpp */,
|
||||
1EE52B551596B3E4006DC938 /* StatisticsBasedScorer.h */,
|
||||
1E3962241594D12C006FE978 /* SentenceLevelScorer.h */,
|
||||
1E3962221594D0FF006FE978 /* SentenceLevelScorer.cpp */,
|
||||
1E39621E1594CFF9006FE978 /* Permutation.cpp */,
|
||||
1E39621F1594CFF9006FE978 /* Permutation.h */,
|
||||
1E3962191594CFD1006FE978 /* PermutationScorer.cpp */,
|
||||
1E43CA3315973474000E29D3 /* PermutationScorer.h */,
|
||||
1E2CCF3A15939E5D00D858D1 /* BleuScorer.cpp */,
|
||||
1E2CCF3B15939E5D00D858D1 /* BleuScorer.h */,
|
||||
1E2CCF3D15939E5D00D858D1 /* CderScorer.cpp */,
|
||||
1E2CCF3E15939E5D00D858D1 /* CderScorer.h */,
|
||||
1E2CCF3F15939E5D00D858D1 /* Data.cpp */,
|
||||
1E2CCF4015939E5D00D858D1 /* Data.h */,
|
||||
1E2CCF5115939E5D00D858D1 /* Fdstream.h */,
|
||||
1E2CCF5215939E5D00D858D1 /* FeatureArray.cpp */,
|
||||
1E2CCF5315939E5D00D858D1 /* FeatureArray.h */,
|
||||
1E2CCF5415939E5D00D858D1 /* FeatureData.cpp */,
|
||||
1E2CCF5515939E5D00D858D1 /* FeatureData.h */,
|
||||
1E2CCF5615939E5D00D858D1 /* FeatureDataIterator.cpp */,
|
||||
1E2CCF5715939E5D00D858D1 /* FeatureDataIterator.h */,
|
||||
1E2CCF5915939E5D00D858D1 /* FeatureStats.cpp */,
|
||||
1E2CCF5A15939E5D00D858D1 /* FeatureStats.h */,
|
||||
1E2CCF5B15939E5D00D858D1 /* FileStream.cpp */,
|
||||
1E2CCF5C15939E5D00D858D1 /* FileStream.h */,
|
||||
1E2CCF5D15939E5D00D858D1 /* GzFileBuf.cpp */,
|
||||
1E2CCF5E15939E5D00D858D1 /* GzFileBuf.h */,
|
||||
1E2CCF5F15939E5D00D858D1 /* HypPackEnumerator.cpp */,
|
||||
1E2CCF6015939E5D00D858D1 /* HypPackEnumerator.h */,
|
||||
1E2CCF6115939E5D00D858D1 /* InterpolatedScorer.cpp */,
|
||||
1E2CCF6215939E5D00D858D1 /* InterpolatedScorer.h */,
|
||||
1E2CCF6515939E5D00D858D1 /* MergeScorer.cpp */,
|
||||
1E2CCF6615939E5D00D858D1 /* MergeScorer.h */,
|
||||
1E2CCF6715939E5D00D858D1 /* mert.cpp */,
|
||||
1E2CCF6815939E5D00D858D1 /* MiraFeatureVector.cpp */,
|
||||
1E2CCF6915939E5D00D858D1 /* MiraFeatureVector.h */,
|
||||
1E2CCF6A15939E5D00D858D1 /* MiraWeightVector.cpp */,
|
||||
1E2CCF6B15939E5D00D858D1 /* MiraWeightVector.h */,
|
||||
1E2CCF6C15939E5D00D858D1 /* Ngram.h */,
|
||||
1E2CCF6E15939E5D00D858D1 /* Optimizer.cpp */,
|
||||
1E2CCF6F15939E5D00D858D1 /* Optimizer.h */,
|
||||
1E2CCF7015939E5D00D858D1 /* OptimizerFactory.cpp */,
|
||||
1E2CCF7115939E5D00D858D1 /* OptimizerFactory.h */,
|
||||
1E2CCF7315939E5D00D858D1 /* PerScorer.cpp */,
|
||||
1E2CCF7415939E5D00D858D1 /* PerScorer.h */,
|
||||
1E2CCF7515939E5D00D858D1 /* Point.cpp */,
|
||||
1E2CCF7615939E5D00D858D1 /* Point.h */,
|
||||
1E2CCF7815939E5D00D858D1 /* PreProcessFilter.cpp */,
|
||||
1E2CCF7915939E5D00D858D1 /* PreProcessFilter.h */,
|
||||
1E2CCF7B15939E5D00D858D1 /* Reference.h */,
|
||||
1E2CCF7D15939E5D00D858D1 /* ScopedVector.h */,
|
||||
1E2CCF7E15939E5D00D858D1 /* ScoreArray.cpp */,
|
||||
1E2CCF7F15939E5D00D858D1 /* ScoreArray.h */,
|
||||
1E2CCF8015939E5D00D858D1 /* ScoreData.cpp */,
|
||||
1E2CCF8115939E5D00D858D1 /* ScoreData.h */,
|
||||
1E2CCF8215939E5D00D858D1 /* ScoreDataIterator.cpp */,
|
||||
1E2CCF8315939E5D00D858D1 /* ScoreDataIterator.h */,
|
||||
1E2CCF8415939E5D00D858D1 /* Scorer.cpp */,
|
||||
1E2CCF8515939E5D00D858D1 /* Scorer.h */,
|
||||
1E2CCF8615939E5D00D858D1 /* ScorerFactory.cpp */,
|
||||
1E2CCF8715939E5D00D858D1 /* ScorerFactory.h */,
|
||||
1E2CCF8815939E5D00D858D1 /* ScoreStats.cpp */,
|
||||
1E2CCF8915939E5D00D858D1 /* ScoreStats.h */,
|
||||
1E2CCF8A15939E5D00D858D1 /* SemposOverlapping.cpp */,
|
||||
1E2CCF8B15939E5D00D858D1 /* SemposOverlapping.h */,
|
||||
1E2CCF8C15939E5D00D858D1 /* SemposScorer.cpp */,
|
||||
1E2CCF8D15939E5D00D858D1 /* SemposScorer.h */,
|
||||
1E2CCF8E15939E5D00D858D1 /* Singleton.h */,
|
||||
1E2CCF9015939E5D00D858D1 /* TER */,
|
||||
1E2CCFA815939E5D00D858D1 /* TerScorer.cpp */,
|
||||
1E2CCFA915939E5D00D858D1 /* TerScorer.h */,
|
||||
1E2CCFAE15939E5D00D858D1 /* Timer.cpp */,
|
||||
1E2CCFAF15939E5D00D858D1 /* Timer.h */,
|
||||
1E2CCFB215939E5D00D858D1 /* Types.h */,
|
||||
1E2CCFB315939E5D00D858D1 /* Util.cpp */,
|
||||
1E2CCFB415939E5D00D858D1 /* Util.h */,
|
||||
1E2CCFB615939E5D00D858D1 /* Vocabulary.cpp */,
|
||||
1E2CCFB715939E5D00D858D1 /* Vocabulary.h */,
|
||||
1E2CCF3415939E2D00D858D1 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1E2CCF3415939E2D00D858D1 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1E2CCF3315939E2D00D858D1 /* libmert_lib.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1E2CCF9015939E5D00D858D1 /* TER */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1E2CCF9115939E5D00D858D1 /* alignmentStruct.cpp */,
|
||||
1E2CCF9215939E5D00D858D1 /* alignmentStruct.h */,
|
||||
1E2CCF9315939E5D00D858D1 /* bestShiftStruct.h */,
|
||||
1E2CCF9415939E5D00D858D1 /* hashMap.cpp */,
|
||||
1E2CCF9515939E5D00D858D1 /* hashMap.h */,
|
||||
1E2CCF9615939E5D00D858D1 /* hashMapInfos.cpp */,
|
||||
1E2CCF9715939E5D00D858D1 /* hashMapInfos.h */,
|
||||
1E2CCF9815939E5D00D858D1 /* hashMapStringInfos.cpp */,
|
||||
1E2CCF9915939E5D00D858D1 /* hashMapStringInfos.h */,
|
||||
1E2CCF9A15939E5D00D858D1 /* infosHasher.cpp */,
|
||||
1E2CCF9B15939E5D00D858D1 /* infosHasher.h */,
|
||||
1E2CCF9C15939E5D00D858D1 /* stringHasher.cpp */,
|
||||
1E2CCF9D15939E5D00D858D1 /* stringHasher.h */,
|
||||
1E2CCF9E15939E5D00D858D1 /* stringInfosHasher.cpp */,
|
||||
1E2CCF9F15939E5D00D858D1 /* stringInfosHasher.h */,
|
||||
1E2CCFA015939E5D00D858D1 /* terAlignment.cpp */,
|
||||
1E2CCFA115939E5D00D858D1 /* terAlignment.h */,
|
||||
1E2CCFA215939E5D00D858D1 /* tercalc.cpp */,
|
||||
1E2CCFA315939E5D00D858D1 /* tercalc.h */,
|
||||
1E2CCFA415939E5D00D858D1 /* terShift.cpp */,
|
||||
1E2CCFA515939E5D00D858D1 /* terShift.h */,
|
||||
1E2CCFA615939E5D00D858D1 /* tools.cpp */,
|
||||
1E2CCFA715939E5D00D858D1 /* tools.h */,
|
||||
);
|
||||
name = TER;
|
||||
path = ../../mert/TER;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
1E2CCF3115939E2D00D858D1 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1E2CCFBA15939E5D00D858D1 /* BleuScorer.h in Headers */,
|
||||
1E2CCFBD15939E5D00D858D1 /* CderScorer.h in Headers */,
|
||||
1E2CCFBF15939E5D00D858D1 /* Data.h in Headers */,
|
||||
1E2CCFC315939E5D00D858D1 /* Fdstream.h in Headers */,
|
||||
1E2CCFC515939E5D00D858D1 /* FeatureArray.h in Headers */,
|
||||
1E2CCFC715939E5D00D858D1 /* FeatureData.h in Headers */,
|
||||
1E2CCFC915939E5D00D858D1 /* FeatureDataIterator.h in Headers */,
|
||||
1E2CCFCC15939E5D00D858D1 /* FeatureStats.h in Headers */,
|
||||
1E2CCFCE15939E5D00D858D1 /* FileStream.h in Headers */,
|
||||
1E2CCFD015939E5D00D858D1 /* GzFileBuf.h in Headers */,
|
||||
1E2CCFD215939E5D00D858D1 /* HypPackEnumerator.h in Headers */,
|
||||
1E2CCFD415939E5D00D858D1 /* InterpolatedScorer.h in Headers */,
|
||||
1E2CCFD815939E5D00D858D1 /* MergeScorer.h in Headers */,
|
||||
1E2CCFDB15939E5D00D858D1 /* MiraFeatureVector.h in Headers */,
|
||||
1E2CCFDD15939E5D00D858D1 /* MiraWeightVector.h in Headers */,
|
||||
1E2CCFDE15939E5D00D858D1 /* Ngram.h in Headers */,
|
||||
1E2CCFE115939E5D00D858D1 /* Optimizer.h in Headers */,
|
||||
1E2CCFE315939E5D00D858D1 /* OptimizerFactory.h in Headers */,
|
||||
1E2CCFE615939E5D00D858D1 /* PerScorer.h in Headers */,
|
||||
1E2CCFE815939E5D00D858D1 /* Point.h in Headers */,
|
||||
1E2CCFEB15939E5D00D858D1 /* PreProcessFilter.h in Headers */,
|
||||
1E2CCFED15939E5D00D858D1 /* Reference.h in Headers */,
|
||||
1E2CCFEF15939E5D00D858D1 /* ScopedVector.h in Headers */,
|
||||
1E2CCFF115939E5D00D858D1 /* ScoreArray.h in Headers */,
|
||||
1E2CCFF315939E5D00D858D1 /* ScoreData.h in Headers */,
|
||||
1E2CCFF515939E5D00D858D1 /* ScoreDataIterator.h in Headers */,
|
||||
1E2CCFF715939E5D00D858D1 /* Scorer.h in Headers */,
|
||||
1E2CCFF915939E5D00D858D1 /* ScorerFactory.h in Headers */,
|
||||
1E2CCFFB15939E5D00D858D1 /* ScoreStats.h in Headers */,
|
||||
1E2CCFFD15939E5D00D858D1 /* SemposOverlapping.h in Headers */,
|
||||
1E2CCFFF15939E5D00D858D1 /* SemposScorer.h in Headers */,
|
||||
1E2CD00015939E5D00D858D1 /* Singleton.h in Headers */,
|
||||
1E2CD00315939E5D00D858D1 /* alignmentStruct.h in Headers */,
|
||||
1E2CD00415939E5D00D858D1 /* bestShiftStruct.h in Headers */,
|
||||
1E2CD00615939E5D00D858D1 /* hashMap.h in Headers */,
|
||||
1E2CD00815939E5D00D858D1 /* hashMapInfos.h in Headers */,
|
||||
1E2CD00A15939E5D00D858D1 /* hashMapStringInfos.h in Headers */,
|
||||
1E2CD00C15939E5D00D858D1 /* infosHasher.h in Headers */,
|
||||
1E2CD00E15939E5D00D858D1 /* stringHasher.h in Headers */,
|
||||
1E2CD01015939E5D00D858D1 /* stringInfosHasher.h in Headers */,
|
||||
1E2CD01215939E5D00D858D1 /* terAlignment.h in Headers */,
|
||||
1E2CD01415939E5D00D858D1 /* tercalc.h in Headers */,
|
||||
1E2CD01615939E5D00D858D1 /* terShift.h in Headers */,
|
||||
1E2CD01815939E5D00D858D1 /* tools.h in Headers */,
|
||||
1E2CD01A15939E5D00D858D1 /* TerScorer.h in Headers */,
|
||||
1E2CD01D15939E5D00D858D1 /* Timer.h in Headers */,
|
||||
1E2CD01F15939E5D00D858D1 /* Types.h in Headers */,
|
||||
1E2CD02115939E5D00D858D1 /* Util.h in Headers */,
|
||||
1E2CD02415939E5D00D858D1 /* Vocabulary.h in Headers */,
|
||||
1E3962211594CFF9006FE978 /* Permutation.h in Headers */,
|
||||
1E3962251594D12C006FE978 /* SentenceLevelScorer.h in Headers */,
|
||||
1EE52B561596B3E4006DC938 /* StatisticsBasedScorer.h in Headers */,
|
||||
1E43CA3415973474000E29D3 /* PermutationScorer.h in Headers */,
|
||||
1E689F22159A529C00DD995A /* ThreadPool.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
1E2CCF3215939E2D00D858D1 /* mert_lib */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1E2CCF3715939E2D00D858D1 /* Build configuration list for PBXNativeTarget "mert_lib" */;
|
||||
buildPhases = (
|
||||
1E2CCF2F15939E2D00D858D1 /* Sources */,
|
||||
1E2CCF3015939E2D00D858D1 /* Frameworks */,
|
||||
1E2CCF3115939E2D00D858D1 /* Headers */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = mert_lib;
|
||||
productName = mert_lib;
|
||||
productReference = 1E2CCF3315939E2D00D858D1 /* libmert_lib.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
1E2CCF2A15939E2D00D858D1 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
buildConfigurationList = 1E2CCF2D15939E2D00D858D1 /* Build configuration list for PBXProject "mert_lib" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 1E2CCF2815939E2D00D858D1;
|
||||
productRefGroup = 1E2CCF3415939E2D00D858D1 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
1E2CCF3215939E2D00D858D1 /* mert_lib */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
1E2CCF2F15939E2D00D858D1 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
1E2CCFB915939E5D00D858D1 /* BleuScorer.cpp in Sources */,
|
||||
1E2CCFBC15939E5D00D858D1 /* CderScorer.cpp in Sources */,
|
||||
1E2CCFBE15939E5D00D858D1 /* Data.cpp in Sources */,
|
||||
1E2CCFC415939E5D00D858D1 /* FeatureArray.cpp in Sources */,
|
||||
1E2CCFC615939E5D00D858D1 /* FeatureData.cpp in Sources */,
|
||||
1E2CCFC815939E5D00D858D1 /* FeatureDataIterator.cpp in Sources */,
|
||||
1E2CCFCB15939E5D00D858D1 /* FeatureStats.cpp in Sources */,
|
||||
1E2CCFCD15939E5D00D858D1 /* FileStream.cpp in Sources */,
|
||||
1E2CCFCF15939E5D00D858D1 /* GzFileBuf.cpp in Sources */,
|
||||
1E2CCFD115939E5D00D858D1 /* HypPackEnumerator.cpp in Sources */,
|
||||
1E2CCFD315939E5D00D858D1 /* InterpolatedScorer.cpp in Sources */,
|
||||
1E2CCFD715939E5D00D858D1 /* MergeScorer.cpp in Sources */,
|
||||
1E2CCFD915939E5D00D858D1 /* mert.cpp in Sources */,
|
||||
1E2CCFDA15939E5D00D858D1 /* MiraFeatureVector.cpp in Sources */,
|
||||
1E2CCFDC15939E5D00D858D1 /* MiraWeightVector.cpp in Sources */,
|
||||
1E2CCFE015939E5D00D858D1 /* Optimizer.cpp in Sources */,
|
||||
1E2CCFE215939E5D00D858D1 /* OptimizerFactory.cpp in Sources */,
|
||||
1E2CCFE515939E5D00D858D1 /* PerScorer.cpp in Sources */,
|
||||
1E2CCFE715939E5D00D858D1 /* Point.cpp in Sources */,
|
||||
1E2CCFEA15939E5D00D858D1 /* PreProcessFilter.cpp in Sources */,
|
||||
1E2CCFF015939E5D00D858D1 /* ScoreArray.cpp in Sources */,
|
||||
1E2CCFF215939E5D00D858D1 /* ScoreData.cpp in Sources */,
|
||||
1E2CCFF415939E5D00D858D1 /* ScoreDataIterator.cpp in Sources */,
|
||||
1E2CCFF615939E5D00D858D1 /* Scorer.cpp in Sources */,
|
||||
1E2CCFF815939E5D00D858D1 /* ScorerFactory.cpp in Sources */,
|
||||
1E2CCFFA15939E5D00D858D1 /* ScoreStats.cpp in Sources */,
|
||||
1E2CCFFC15939E5D00D858D1 /* SemposOverlapping.cpp in Sources */,
|
||||
1E2CCFFE15939E5D00D858D1 /* SemposScorer.cpp in Sources */,
|
||||
1E2CD00215939E5D00D858D1 /* alignmentStruct.cpp in Sources */,
|
||||
1E2CD00515939E5D00D858D1 /* hashMap.cpp in Sources */,
|
||||
1E2CD00715939E5D00D858D1 /* hashMapInfos.cpp in Sources */,
|
||||
1E2CD00915939E5D00D858D1 /* hashMapStringInfos.cpp in Sources */,
|
||||
1E2CD00B15939E5D00D858D1 /* infosHasher.cpp in Sources */,
|
||||
1E2CD00D15939E5D00D858D1 /* stringHasher.cpp in Sources */,
|
||||
1E2CD00F15939E5D00D858D1 /* stringInfosHasher.cpp in Sources */,
|
||||
1E2CD01115939E5D00D858D1 /* terAlignment.cpp in Sources */,
|
||||
1E2CD01315939E5D00D858D1 /* tercalc.cpp in Sources */,
|
||||
1E2CD01515939E5D00D858D1 /* terShift.cpp in Sources */,
|
||||
1E2CD01715939E5D00D858D1 /* tools.cpp in Sources */,
|
||||
1E2CD01915939E5D00D858D1 /* TerScorer.cpp in Sources */,
|
||||
1E2CD01C15939E5D00D858D1 /* Timer.cpp in Sources */,
|
||||
1E2CD02015939E5D00D858D1 /* Util.cpp in Sources */,
|
||||
1E2CD02315939E5D00D858D1 /* Vocabulary.cpp in Sources */,
|
||||
1E39621B1594CFD1006FE978 /* PermutationScorer.cpp in Sources */,
|
||||
1E3962201594CFF9006FE978 /* Permutation.cpp in Sources */,
|
||||
1E3962231594D0FF006FE978 /* SentenceLevelScorer.cpp in Sources */,
|
||||
1EE52B591596B3FC006DC938 /* StatisticsBasedScorer.cpp in Sources */,
|
||||
1E689F21159A529C00DD995A /* ThreadPool.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
1E2CCF3515939E2D00D858D1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1E2CCF3615939E2D00D858D1 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
1E2CCF3815939E2D00D858D1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
"GCC_PREPROCESSOR_DEFINITIONS[arch=*]" = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
WITH_THREADS,
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../..,
|
||||
/opt/local/include,
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1E2CCF3915939E2D00D858D1 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = WITH_THREADS;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../..,
|
||||
/opt/local/include,
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
1E2CCF2D15939E2D00D858D1 /* Build configuration list for PBXProject "mert_lib" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1E2CCF3515939E2D00D858D1 /* Debug */,
|
||||
1E2CCF3615939E2D00D858D1 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
1E2CCF3715939E2D00D858D1 /* Build configuration list for PBXNativeTarget "mert_lib" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1E2CCF3815939E2D00D858D1 /* Debug */,
|
||||
1E2CCF3915939E2D00D858D1 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 1E2CCF2A15939E2D00D858D1 /* Project object */;
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "1E2CCF3215939E2D00D858D1"
|
||||
BuildableName = "libmert_lib.a"
|
||||
BlueprintName = "mert_lib"
|
||||
ReferencedContainer = "container:mert_lib.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug">
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release">
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>mert_lib.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>1E2CCF3215939E2D00D858D1</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
@ -93,13 +93,11 @@
|
||||
<ClCompile Include="src\IOWrapper.cpp" />
|
||||
<ClCompile Include="src\Main.cpp" />
|
||||
<ClCompile Include="src\mbr.cpp" />
|
||||
<ClCompile Include="src\TranslationAnalysis.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\IOWrapper.h" />
|
||||
<ClInclude Include="src\Main.h" />
|
||||
<ClInclude Include="src\mbr.h" />
|
||||
<ClInclude Include="src\TranslationAnalysis.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\moses\moses.vcxproj">
|
||||
|
@ -47,8 +47,8 @@
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\boost\boost_1_47;$(SolutionDir)/../../moses/src;$(SolutionDir)/../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>C:\boost\boost_1_47;$(SolutionDir)/../../moses/src;$(SolutionDir)/../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WITH_THREADS;NO_PIPES;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
@ -58,19 +58,20 @@
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>zdll.lib;$(SolutionDir)$(Configuration)\moses.lib;$(SolutionDir)$(Configuration)\kenlm.lib;$(SolutionDir)$(Configuration)\OnDiskPt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>C:\GnuWin32\lib\zlib.lib;$(SolutionDir)$(Configuration)\moses.lib;$(SolutionDir)$(Configuration)\kenlm.lib;$(SolutionDir)$(Configuration)\OnDiskPt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalLibraryDirectories>C:\boost\boost_1_47\lib</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\boost\boost_1_47;$(SolutionDir)/../../moses/src;$(SolutionDir)/../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>C:\boost\boost_1_47;$(SolutionDir)/../../moses/src;$(SolutionDir)/../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WITH_THREADS;NO_PIPES;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
@ -78,7 +79,7 @@
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>zdll.lib;$(SolutionDir)$(Configuration)\moses.lib;$(SolutionDir)$(Configuration)\kenlm.lib;$(SolutionDir)$(Configuration)\OnDiskPt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>C:\GnuWin32\lib\zlib.lib;$(SolutionDir)$(Configuration)\moses.lib;$(SolutionDir)$(Configuration)\kenlm.lib;$(SolutionDir)$(Configuration)\OnDiskPt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
@ -87,6 +88,7 @@
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalLibraryDirectories>C:\boost\boost_1_47\lib</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
@ -39,9 +39,7 @@ Global
|
||||
{E2233DB1-5592-46FE-9420-E529420612FA}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E2233DB1-5592-46FE-9420-E529420612FA}.Release|Win32.Build.0 = Release|Win32
|
||||
{88AE90C9-72D2-42ED-8389-770ACDCD4308}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{88AE90C9-72D2-42ED-8389-770ACDCD4308}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{88AE90C9-72D2-42ED-8389-770ACDCD4308}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{88AE90C9-72D2-42ED-8389-770ACDCD4308}.Release|Win32.Build.0 = Release|Win32
|
||||
{A5402E0B-6ED7-465C-9669-E4124A0CDDCB}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{A5402E0B-6ED7-465C-9669-E4124A0CDDCB}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{A5402E0B-6ED7-465C-9669-E4124A0CDDCB}.Release|Win32.ActiveCfg = Release|Win32
|
||||
|
@ -22,9 +22,6 @@
|
||||
<ClInclude Include="..\..\moses\src\ChartHypothesis.h" />
|
||||
<ClInclude Include="..\..\moses\src\ChartHypothesisCollection.h" />
|
||||
<ClInclude Include="..\..\moses\src\ChartManager.h" />
|
||||
<ClInclude Include="..\..\moses\src\ChartRuleLookupManager.h" />
|
||||
<ClInclude Include="..\..\moses\src\ChartRuleLookupManagerMemory.h" />
|
||||
<ClInclude Include="..\..\moses\src\ChartRuleLookupManagerOnDisk.h" />
|
||||
<ClInclude Include="..\..\moses\src\ChartTranslationOption.h" />
|
||||
<ClInclude Include="..\..\moses\src\ChartTranslationOptionCollection.h" />
|
||||
<ClInclude Include="..\..\moses\src\ChartTranslationOptionList.h" />
|
||||
@ -34,16 +31,24 @@
|
||||
<ClInclude Include="..\..\moses\src\ChartTrellisPath.h" />
|
||||
<ClInclude Include="..\..\moses\src\ChartTrellisPathList.h" />
|
||||
<ClInclude Include="..\..\moses\src\ConfusionNet.h" />
|
||||
<ClInclude Include="..\..\moses\src\CYKPlusParser\ChartRuleLookupManagerCYKPlus.h" />
|
||||
<ClInclude Include="..\..\moses\src\CYKPlusParser\ChartRuleLookupManagerMemory.h" />
|
||||
<ClInclude Include="..\..\moses\src\CYKPlusParser\ChartRuleLookupManagerOnDisk.h" />
|
||||
<ClInclude Include="..\..\moses\src\CYKPlusParser\DotChart.h" />
|
||||
<ClInclude Include="..\..\moses\src\CYKPlusParser\DotChartInMemory.h" />
|
||||
<ClInclude Include="..\..\moses\src\CYKPlusParser\DotChartOnDisk.h" />
|
||||
<ClInclude Include="..\..\moses\src\DecodeFeature.h" />
|
||||
<ClInclude Include="..\..\moses\src\DecodeGraph.h" />
|
||||
<ClInclude Include="..\..\moses\src\DecodeStep.h" />
|
||||
<ClInclude Include="..\..\moses\src\DecodeStepGeneration.h" />
|
||||
<ClInclude Include="..\..\moses\src\DecodeStepTranslation.h" />
|
||||
<ClInclude Include="..\..\moses\src\Dictionary.h" />
|
||||
<ClInclude Include="..\..\moses\src\DotChart.h" />
|
||||
<ClInclude Include="..\..\moses\src\DotChartInMemory.h" />
|
||||
<ClInclude Include="..\..\moses\src\DotChartOnDisk.h" />
|
||||
<ClInclude Include="..\..\moses\src\DummyScoreProducers.h" />
|
||||
<ClInclude Include="..\..\moses\src\DynSAInclude\file.h" />
|
||||
<ClInclude Include="..\..\moses\src\DynSAInclude\FileHandler.h" />
|
||||
<ClInclude Include="..\..\moses\src\DynSAInclude\onlineRLM.h" />
|
||||
<ClInclude Include="..\..\moses\src\DynSAInclude\quantizer.h" />
|
||||
<ClInclude Include="..\..\moses\src\DynSAInclude\vocab.h" />
|
||||
<ClInclude Include="..\..\moses\src\DynSuffixArray.h" />
|
||||
<ClInclude Include="..\..\moses\src\Factor.h" />
|
||||
<ClInclude Include="..\..\moses\src\FactorCollection.h" />
|
||||
@ -73,6 +78,7 @@
|
||||
<ClInclude Include="..\..\moses\src\LM\Joint.h" />
|
||||
<ClInclude Include="..\..\moses\src\LM\Ken.h" />
|
||||
<ClInclude Include="..\..\moses\src\LM\MultiFactor.h" />
|
||||
<ClInclude Include="..\..\moses\src\LM\ORLM.h" />
|
||||
<ClInclude Include="..\..\moses\src\LM\SingleFactor.h" />
|
||||
<ClInclude Include="..\..\moses\src\LVoc.h" />
|
||||
<ClInclude Include="..\..\moses\src\Manager.h" />
|
||||
@ -85,13 +91,9 @@
|
||||
<ClInclude Include="..\..\moses\src\PDTAimp.h" />
|
||||
<ClInclude Include="..\..\moses\src\Phrase.h" />
|
||||
<ClInclude Include="..\..\moses\src\PhraseDictionary.h" />
|
||||
<ClInclude Include="..\..\moses\src\PhraseDictionaryALSuffixArray.h" />
|
||||
<ClInclude Include="..\..\moses\src\PhraseDictionaryDynSuffixArray.h" />
|
||||
<ClInclude Include="..\..\moses\src\PhraseDictionaryMemory.h" />
|
||||
<ClInclude Include="..\..\moses\src\PhraseDictionaryNode.h" />
|
||||
<ClInclude Include="..\..\moses\src\PhraseDictionaryNodeSCFG.h" />
|
||||
<ClInclude Include="..\..\moses\src\PhraseDictionaryOnDisk.h" />
|
||||
<ClInclude Include="..\..\moses\src\PhraseDictionarySCFG.h" />
|
||||
<ClInclude Include="..\..\moses\src\PhraseDictionaryTree.h" />
|
||||
<ClInclude Include="..\..\moses\src\PhraseDictionaryTreeAdaptor.h" />
|
||||
<ClInclude Include="..\..\moses\src\PrefixTree.h" />
|
||||
@ -106,13 +108,29 @@
|
||||
<ClInclude Include="..\..\moses\src\RuleTable\LoaderFactory.h" />
|
||||
<ClInclude Include="..\..\moses\src\RuleTable\LoaderHiero.h" />
|
||||
<ClInclude Include="..\..\moses\src\RuleTable\LoaderStandard.h" />
|
||||
<ClInclude Include="..\..\moses\src\RuleTable\PhraseDictionaryALSuffixArray.h" />
|
||||
<ClInclude Include="..\..\moses\src\RuleTable\PhraseDictionaryNodeSCFG.h" />
|
||||
<ClInclude Include="..\..\moses\src\RuleTable\PhraseDictionaryOnDisk.h" />
|
||||
<ClInclude Include="..\..\moses\src\RuleTable\PhraseDictionarySCFG.h" />
|
||||
<ClInclude Include="..\..\moses\src\RuleTable\Trie.h" />
|
||||
<ClInclude Include="..\..\moses\src\RuleTable\UTrie.h" />
|
||||
<ClInclude Include="..\..\moses\src\RuleTable\UTrieNode.h" />
|
||||
<ClInclude Include="..\..\moses\src\Scope3Parser\ApplicableRuleTrie.h" />
|
||||
<ClInclude Include="..\..\moses\src\Scope3Parser\IntermediateVarSpanNode.h" />
|
||||
<ClInclude Include="..\..\moses\src\Scope3Parser\Parser.h" />
|
||||
<ClInclude Include="..\..\moses\src\Scope3Parser\SentenceMap.h" />
|
||||
<ClInclude Include="..\..\moses\src\Scope3Parser\StackLattice.h" />
|
||||
<ClInclude Include="..\..\moses\src\Scope3Parser\StackLatticeBuilder.h" />
|
||||
<ClInclude Include="..\..\moses\src\Scope3Parser\StackLatticeSearcher.h" />
|
||||
<ClInclude Include="..\..\moses\src\Scope3Parser\VarSpanNode.h" />
|
||||
<ClInclude Include="..\..\moses\src\Scope3Parser\VarSpanTrieBuilder.h" />
|
||||
<ClInclude Include="..\..\moses\src\ScoreComponentCollection.h" />
|
||||
<ClInclude Include="..\..\moses\src\ScoreIndexManager.h" />
|
||||
<ClInclude Include="..\..\moses\src\ScoreProducer.h" />
|
||||
<ClInclude Include="..\..\moses\src\Search.h" />
|
||||
<ClInclude Include="..\..\moses\src\SearchCubePruning.h" />
|
||||
<ClInclude Include="..\..\moses\src\SearchNormal.h" />
|
||||
<ClInclude Include="..\..\moses\src\SearchNormalBatch.h" />
|
||||
<ClInclude Include="..\..\moses\src\Sentence.h" />
|
||||
<ClInclude Include="..\..\moses\src\SentenceStats.h" />
|
||||
<ClInclude Include="..\..\moses\src\SquareMatrix.h" />
|
||||
@ -150,9 +168,6 @@
|
||||
<ClCompile Include="..\..\moses\src\ChartHypothesis.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\ChartHypothesisCollection.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\ChartManager.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\ChartRuleLookupManager.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\ChartRuleLookupManagerMemory.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\ChartRuleLookupManagerOnDisk.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\ChartTranslationOption.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\ChartTranslationOptionCollection.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\ChartTranslationOptionList.cpp" />
|
||||
@ -161,16 +176,20 @@
|
||||
<ClCompile Include="..\..\moses\src\ChartTrellisNode.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\ChartTrellisPath.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\ConfusionNet.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\CYKPlusParser\ChartRuleLookupManagerCYKPlus.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\CYKPlusParser\ChartRuleLookupManagerMemory.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\CYKPlusParser\ChartRuleLookupManagerOnDisk.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\CYKPlusParser\DotChartInMemory.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\CYKPlusParser\DotChartOnDisk.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\DecodeFeature.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\DecodeGraph.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\DecodeStep.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\DecodeStepGeneration.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\DecodeStepTranslation.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\Dictionary.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\DotChart.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\DotChartInMemory.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\DotChartOnDisk.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\DummyScoreProducers.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\DynSAInclude\FileHandler.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\DynSAInclude\vocab.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\DynSuffixArray.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\Factor.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\FactorCollection.cpp" />
|
||||
@ -198,6 +217,7 @@
|
||||
<ClCompile Include="..\..\moses\src\LM\Joint.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\LM\Ken.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\LM\MultiFactor.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\LM\ORLM.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\LM\SingleFactor.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\LVoc.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\Manager.cpp" />
|
||||
@ -207,13 +227,9 @@
|
||||
<ClCompile Include="..\..\moses\src\PCNTools.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\Phrase.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\PhraseDictionary.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\PhraseDictionaryALSuffixArray.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\PhraseDictionaryDynSuffixArray.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\PhraseDictionaryMemory.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\PhraseDictionaryNode.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\PhraseDictionaryNodeSCFG.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\PhraseDictionaryOnDisk.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\PhraseDictionarySCFG.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\PhraseDictionaryTree.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\PhraseDictionaryTreeAdaptor.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\PrefixTreeMap.cpp" />
|
||||
@ -226,13 +242,24 @@
|
||||
<ClCompile Include="..\..\moses\src\RuleTable\LoaderFactory.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\RuleTable\LoaderHiero.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\RuleTable\LoaderStandard.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\RuleTable\PhraseDictionaryALSuffixArray.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\RuleTable\PhraseDictionaryNodeSCFG.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\RuleTable\PhraseDictionaryOnDisk.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\RuleTable\PhraseDictionarySCFG.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\RuleTable\Trie.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\RuleTable\UTrie.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\RuleTable\UTrieNode.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\Scope3Parser\ApplicableRuleTrie.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\Scope3Parser\Parser.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\Scope3Parser\StackLatticeBuilder.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\Scope3Parser\VarSpanTrieBuilder.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\ScoreComponentCollection.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\ScoreIndexManager.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\ScoreProducer.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\Search.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\SearchCubePruning.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\SearchNormal.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\SearchNormalBatch.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\Sentence.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\SentenceStats.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\SquareMatrix.cpp" />
|
||||
@ -258,6 +285,9 @@
|
||||
<ClCompile Include="..\..\moses\src\WordsRange.cpp" />
|
||||
<ClCompile Include="..\..\moses\src\XmlOption.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\util\file.hh" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{8122157A-0DE5-44FF-8E5B-024ED6ACE7AF}</ProjectGuid>
|
||||
<RootNamespace>moses</RootNamespace>
|
||||
@ -289,17 +319,17 @@
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\Program Files\boost\boost_1_47;$(IncludePath)</IncludePath>
|
||||
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\Program Files\boost\boost_1_47;$(IncludePath)</IncludePath>
|
||||
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\GnuWin32\include;C:\Program Files\boost\boost_1_47;$(IncludePath)</IncludePath>
|
||||
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\GnuWin32\include;C:\Program Files\boost\boost_1_47;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\boost\boost_1_47;$(SolutionDir)/../../moses/src;$(SolutionDir)/../../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;LM_INTERNAL;TRACE_ENABLE;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\lm\msinttypes;C:\boost\boost_1_47;$(SolutionDir)/../../moses/src;$(SolutionDir)/../../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WITH_THREADS;NO_PIPES;WIN32;_DEBUG;_CONSOLE;TRACE_ENABLE;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
@ -314,9 +344,9 @@
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<AdditionalIncludeDirectories>C:\Program Files\boost\boost_1_47;$(SolutionDir)/../../moses/src;$(SolutionDir)/../../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;LM_INTERNAL;TRACE_ENABLE;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\lm\msinttypes;C:\boost\boost_1_47;$(SolutionDir)/../../moses/src;$(SolutionDir)/../../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WITH_THREADS;NO_PIPES;WIN32;NDEBUG;_CONSOLE;LM_INTERNAL;TRACE_ENABLE;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|