Skip to content

Commit

Permalink
Implements synonyms
Browse files Browse the repository at this point in the history
Bump to 1.1.2
  • Loading branch information
cpina committed Feb 7, 2021
1 parent 108368d commit e81170c
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

SET( QDACCO_VERSION 1.1.1 )
SET( QDACCO_VERSION 1.1.2 )

STRING( REGEX MATCHALL "[0-9]+" QDACCO_VERSIONS ${QDACCO_VERSION} )
LIST( GET QDACCO_VERSIONS 0 QDACCO_VERSION_MAJOR)
Expand Down
4 changes: 4 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
qdacco 1.1.2 (February 2021)
============
-Implement "synonyms" (e.g. "quickly" in eng->cat)

qdacco 1.1.1 (February 2021)
============
Fix small errors:
Expand Down
Binary file modified gui/qdacco_ca.qm
Binary file not shown.
50 changes: 30 additions & 20 deletions gui/qdacco_ca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ Dades llicenciades amb LGPL.</translation>
</message>
<message>
<location filename="main.ui" line="224"/>
<location filename="main.cpp" line="59"/>
<location filename="main.cpp" line="57"/>
<source>Copy</source>
<translation>Copia</translation>
</message>
Expand Down Expand Up @@ -528,32 +528,32 @@ Dades llicenciades amb LGPL.</translation>
<translation>ang → cat</translation>
</message>
<message>
<location filename="main.cpp" line="60"/>
<location filename="main.cpp" line="58"/>
<source>Paste</source>
<translation>Enganxa</translation>
</message>
<message>
<location filename="main.cpp" line="90"/>
<location filename="main.cpp" line="88"/>
<source>Festival executed and returned error code: </source>
<translation>Festival ha estat executat i ha retornat el codi d&apos;error: </translation>
</message>
<message>
<location filename="main.cpp" line="90"/>
<location filename="main.cpp" line="88"/>
<source>Please consult the FAQ for help with this issue</source>
<translation>Consulteu les PUF per a més ajuda</translation>
</message>
<message>
<location filename="main.cpp" line="94"/>
<location filename="main.cpp" line="92"/>
<source>You probably haven&apos;t installed the Catalan dictionary for Festival</source>
<translation>Probablement no teniu el diccionari català per Festival</translation>
</message>
<message>
<location filename="main.cpp" line="102"/>
<location filename="main.cpp" line="100"/>
<source>Error executing Festival. Please check the FAQ for help with this issue</source>
<translation>Error executant Festival. Mireu el FAQ per ajuda</translation>
</message>
<message>
<location filename="main.cpp" line="106"/>
<location filename="main.cpp" line="664"/>
<source>Error executing browser. Please check the FAQ for help with this issue</source>
<translation>Error executant el navegador. Mireu el FAQ per ajuda</translation>
</message>
Expand All @@ -566,18 +566,18 @@ Dades llicenciades amb LGPL.</translation>
<translation type="vanished">Error executant el navegador. Si us plau, consulteu les PUF per ajuda en aquesta incidència</translation>
</message>
<message>
<location filename="main.cpp" line="363"/>
<location filename="main.cpp" line="422"/>
<location filename="main.cpp" line="357"/>
<location filename="main.cpp" line="416"/>
<source>Cannot open dictionary file. Check configuration directory and permissions</source>
<translation>No es pot obrir el diccionari. Comproveu el directori i els permisos del diccionari</translation>
</message>
<message>
<location filename="main.cpp" line="412"/>
<location filename="main.cpp" line="406"/>
<source>You have to write a word. The word has to start with a letter.</source>
<translation>Heu d&apos;escriure una paraula. La paraula ha de començar amb una lletra.</translation>
</message>
<message>
<location filename="main.cpp" line="458"/>
<location filename="main.cpp" line="452"/>
<source>Exact match not found</source>
<translation>Coincidència exacte no trobada</translation>
</message>
Expand All @@ -586,7 +586,7 @@ Dades llicenciades amb LGPL.</translation>
<translation type="vanished">Envia comentari(s)</translation>
</message>
<message>
<location filename="main.cpp" line="567"/>
<location filename="main.cpp" line="561"/>
<source>There is no configuration or old configuration. A configuration dialog will now open</source>
<translation>No hi ha configuració o és massa vella. S&apos;obrirà el diàleg de configuració</translation>
</message>
Expand Down Expand Up @@ -702,43 +702,53 @@ Dades llicenciades amb LGPL.</translation>
</message>
<message>
<location filename="../nongui/WordData.h" line="113"/>
<source>Common mistakes</source>
<translation>Errors habituals</translation>
</message>
<message>
<location filename="../nongui/WordData.h" line="115"/>
<source>Plural</source>
<translation>Plural</translation>
</message>
<message>
<location filename="../nongui/WordData.h" line="115"/>
<location filename="../nongui/WordData.h" line="117"/>
<source>Female</source>
<translation>Femení</translation>
</message>
<message>
<location filename="../nongui/WordData.h" line="117"/>
<location filename="../nongui/WordData.h" line="119"/>
<source>Female plural</source>
<translation>Femení plural</translation>
</message>
<message>
<location filename="../nongui/WordData.h" line="119"/>
<location filename="../nongui/WordData.h" line="205"/>
<location filename="../nongui/WordData.h" line="121"/>
<location filename="../nongui/WordData.h" line="208"/>
<source>Catalan acronym</source>
<translation>Acrònim català</translation>
</message>
<message>
<location filename="../nongui/WordData.h" line="121"/>
<location filename="../nongui/WordData.h" line="207"/>
<location filename="../nongui/WordData.h" line="123"/>
<location filename="../nongui/WordData.h" line="210"/>
<source>English acronym</source>
<translation>Acrònim anglès</translation>
</message>
<message>
<location filename="../nongui/WordData.h" line="125"/>
<source>Synonyms</source>
<translation>Sinònims</translation>
</message>
<message>
<location filename="../nongui/WordData.h" line="128"/>
<source>Example</source>
<translation>Exemple</translation>
</message>
<message>
<location filename="../nongui/WordData.h" line="129"/>
<location filename="../nongui/WordData.h" line="132"/>
<source>Note</source>
<translation>Nota</translation>
</message>
<message>
<location filename="../nongui/WordData.h" line="132"/>
<location filename="../nongui/WordData.h" line="136"/>
<source>Picture</source>
<translation>Foto</translation>
</message>
Expand Down
9 changes: 9 additions & 0 deletions nongui/StructureParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ bool StructureParser::startElement(const QString& nameSpaceUri, const QString& l
m_inFems = true;
} else if (qName == "femplural") {
m_inFemPlural = true;
} else if (qName == "synonyms") {
m_inSynonyms = true;
} else if (exampleElements.contains(qName)) {
m_inExample = true;
} else if (noteElements.contains(qName)) {
Expand All @@ -100,6 +102,7 @@ bool StructureParser::characters(const QString& chrs)
m_inCatAcro = false;
m_inEngAcro = false;
m_inMistakes = false;
m_inSynonyms = false;

m_type = QString();
}
Expand All @@ -115,6 +118,9 @@ bool StructureParser::characters(const QString& chrs)
if (m_inTranslation && m_inPlural) {
m_translation.plural = ch;
}
else if (m_inTranslation && m_inSynonyms) {
m_translation.synonyms = ch;
}
else if (m_inTranslation && m_inCatAcro) {
m_translation.catalanAcronym = ch;
}
Expand Down Expand Up @@ -190,6 +196,9 @@ bool StructureParser::endElement(const QString& nameSpaceUri, const QString& loc
m_wordData.setMistakes(m_mistakes);
m_mistakes = QString();
}
else if (qName == "synonyms") {
m_inSynonyms = false;
}

if (exampleElements.contains(qName)) {
m_inExample = false;
Expand Down
1 change: 1 addition & 0 deletions nongui/StructureParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class StructureParser : public QXmlDefaultHandler
bool m_inCatAcro;
bool m_inEngAcro;
bool m_inMistakes;
bool m_inSynonyms;

bool m_inSearchedWord;

Expand Down
3 changes: 2 additions & 1 deletion nongui/WordData.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct Translation {
QString catagory;
QString gender;

QStringList synonyms;
QString synonyms;
QString picture;

QString catalanAcronym;
Expand Down Expand Up @@ -122,6 +122,7 @@ struct Translation {

html += formatInformation(QObject::tr("English acronym"), englishAcronym);

html += formatInformation(QObject::tr("Synonyms"), synonyms);

for (const QString& example: examples) {
html += formatInformation(QObject::tr("Example"), example);
Expand Down

0 comments on commit e81170c

Please sign in to comment.