parley
Scripting::Translation Class Reference
KEduVocTranslation wrapper class for scripting with Kross. More...
#include <translation.h>

Public Slots | |
| void | addAntonym (Translation *antonym) |
| void | addFalseFriend (Translation *falseFriend) |
| void | addSynonym (Translation *synonym) |
| QVariantList | antonyms () const |
| QObject * | conjugation (const QString &tense, const KEduVocWordFlags &flags) |
| QStringList | conjugationTenses () const |
| QStringList | conjugationTexts (const QString &tense, const KEduVocWordFlags &flags) |
| QStringList | conjugationTexts (const QString &tense) |
| QVariantList | falseFriends () const |
| QStringList | multipleChoice () |
| void | removeAntonym (Translation *antonym) |
| void | removeFalseFriend (Translation *falseFriend) |
| void | removeSynonym (Translation *synonym) |
| void | setConjugation (QObject *conjugation, const QString &tense, const KEduVocWordFlags &flags) |
| void | setConjugationText (const QString &conjugation, const QString &tense, const KEduVocWordFlags &flags) |
| QVariantList | synonyms () const |
| QString | wordType () const |
Public Member Functions | |
| Translation (KEduVocTranslation *translation) | |
| Translation (Expression *entry, const QString &translation) | |
| Translation (Expression *entry) | |
| ~Translation () | |
| QString | comment () const |
| QString | comparative () const |
| QString | example () const |
| QString | imageUrl () |
| KEduVocTranslation * | kEduVocTranslation () |
| QString | paraphrase () const |
| QString | pronunciation () const |
| void | setComment (const QString &expr) |
| void | setComparative (const QString &comparative) |
| void | setExample (const QString &expression) |
| void | setImageUrl (const QString &url) |
| void | setParaphrase (const QString &expression) |
| void | setPronunciation (const QString &expression) |
| void | setSoundUrl (const QString &url) |
| void | setSuperlative (const QString &superlative) |
| void | setWordType (KEduVocWordType *wordType) |
| QString | soundUrl () |
| QString | superlative () const |
| template<class T , class S > | |
| QVariantList | toVariantList (QList< T * > objList) const |
Properties | |
| QString | comment |
| QString | comparative |
| QString | example |
| QString | imageUrl |
| QString | paraphrase |
| QString | pronunciation |
| QString | soundUrl |
| QString | superlative |
Detailed Description
KEduVocTranslation wrapper class for scripting with Kross.
Definition at line 36 of file translation.h.
Constructor & Destructor Documentation
| Scripting::Translation::Translation | ( | Expression * | entry | ) |
Definition at line 19 of file translation.cpp.
| Scripting::Translation::Translation | ( | Expression * | entry, | |
| const QString & | translation | |||
| ) |
Definition at line 25 of file translation.cpp.
| Scripting::Translation::Translation | ( | KEduVocTranslation * | translation | ) |
Definition at line 31 of file translation.cpp.
| Scripting::Translation::~Translation | ( | ) |
Definition at line 36 of file translation.cpp.
Member Function Documentation
| void Scripting::Translation::addAntonym | ( | Translation * | antonym | ) | [inline, slot] |
Add a antonym.
- Parameters:
-
antonym An excisting translation object that contains the antonym
Definition at line 239 of file translation.h.
| void Scripting::Translation::addFalseFriend | ( | Translation * | falseFriend | ) | [inline, slot] |
Add a false friend.
- Parameters:
-
falseFriend false friend of this index
Definition at line 215 of file translation.h.
| void Scripting::Translation::addSynonym | ( | Translation * | synonym | ) | [inline, slot] |
Add a synonym.
- Parameters:
-
synonym An excisting translation object that contains the synonym
Definition at line 227 of file translation.h.
| QVariantList Scripting::Translation::antonyms | ( | ) | const [inline, slot] |
Returns antonyms of this expression.
- Returns:
- antonyms (list of Translation objects)
Definition at line 263 of file translation.h.
| QString Scripting::Translation::comment | ( | ) | const [inline] |
Definition at line 92 of file translation.h.
| QString Scripting::Translation::comparative | ( | ) | const [inline] |
Definition at line 168 of file translation.h.
| QObject * Scripting::Translation::conjugation | ( | const QString & | tense, | |
| const KEduVocWordFlags & | flags | |||
| ) | [slot] |
returns the conjugation of the verb in the given tense, number and person
- Parameters:
-
tense The conjugation tense (see Document::tenses()) number The conjugation number. See Parley::Number enum person The conjugation person. See Parley::Person enum
- Returns:
- A Text object that represents the conjugation
Definition at line 54 of file translation.cpp.
| QStringList Scripting::Translation::conjugationTenses | ( | ) | const [inline, slot] |
returns a string list with the available conjugation tenses
Definition at line 272 of file translation.h.
| QStringList Scripting::Translation::conjugationTexts | ( | const QString & | tense, | |
| const KEduVocWordFlags & | flags | |||
| ) | [slot] |
Returns the conjugations of the given tense and number.
- Parameters:
-
tense The tense of conjugation number Conjugation number. See Parley::Number enum
- Returns:
- A String list with 5 conjugations in the order of [First, Second, ThirdMale, ThirdFemale, Third]
Definition at line 84 of file translation.cpp.
| QStringList Scripting::Translation::conjugationTexts | ( | const QString & | tense | ) | [slot] |
Returns all the possible conjugations of the given tense.
- Parameters:
-
tense The tense of the conjugation
- Returns:
- A String list with 15 entries. First 5 are for Singluar [First, Second, ThirdMale, ThirdFemale, ThirdNeutral/Third], next 5 for Dual (in a similar way) and last 5 for plural.
Definition at line 71 of file translation.cpp.
| QString Scripting::Translation::example | ( | ) | const [inline] |
Definition at line 99 of file translation.h.
| QVariantList Scripting::Translation::falseFriends | ( | ) | const [inline, slot] |
Returns false friends of this expression.
- Returns:
- list of false friends (list of Translation objects)
Definition at line 251 of file translation.h.
| QString Scripting::Translation::imageUrl | ( | ) | [inline] |
Definition at line 187 of file translation.h.
| KEduVocTranslation* Scripting::Translation::kEduVocTranslation | ( | ) | [inline] |
Definition at line 77 of file translation.h.
| QStringList Scripting::Translation::multipleChoice | ( | ) | [inline, slot] |
returns multiple choice if available
Definition at line 269 of file translation.h.
| QString Scripting::Translation::paraphrase | ( | ) | const [inline] |
Definition at line 112 of file translation.h.
| QString Scripting::Translation::pronunciation | ( | ) | const [inline] |
Definition at line 87 of file translation.h.
| void Scripting::Translation::removeAntonym | ( | Translation * | antonym | ) | [inline, slot] |
Remove a antonym.
- Parameters:
-
antonym An excisting translation object that contains the synonym
Definition at line 245 of file translation.h.
| void Scripting::Translation::removeFalseFriend | ( | Translation * | falseFriend | ) | [inline, slot] |
Remove a false friend.
- Parameters:
-
falseFriend false friend of this index
Definition at line 221 of file translation.h.
| void Scripting::Translation::removeSynonym | ( | Translation * | synonym | ) | [inline, slot] |
Remove a synonym.
- Parameters:
-
synonym An excisting translation object that contains the synonym
Definition at line 233 of file translation.h.
| void Scripting::Translation::setComment | ( | const QString & | expr | ) | [inline] |
Definition at line 94 of file translation.h.
| void Scripting::Translation::setComparative | ( | const QString & | comparative | ) | [inline] |
Definition at line 169 of file translation.h.
| void Scripting::Translation::setConjugation | ( | QObject * | conjugation, | |
| const QString & | tense, | |||
| const KEduVocWordFlags & | flags | |||
| ) | [slot] |
Sets the conjugation of the verb in the given tense, number and person.
Use this method instead of setConjugationText when the grades, practice count etc are important and want them to be set in this conjugation
- Parameters:
-
conjugation Scripting::Text object as the conjugation tense The tense that conjugationbelongs to (see Document::tenses())number The number of the conjugation. See Parley::Number enumperson The person of the conjugation. See Parley::Person enum
Definition at line 60 of file translation.cpp.
| void Scripting::Translation::setConjugationText | ( | const QString & | conjugation, | |
| const QString & | tense, | |||
| const KEduVocWordFlags & | flags | |||
| ) | [slot] |
Sets the conjugation of the verb in the given tense, number and person.
#how to add a conjugation for a verb import Parley #set the tenses of this document (if not previously done) Parley.doc.setTenses(["present","past simple"]) #iterate through all the word translations and find word "play" for entry in Parley.doc.rootLesson.entries(True): for tr in entry.translations(): if tr.text == "play": #make sure it's marked as a verb Parley.doc.setWordType(tr,"Verb") #add conjugations tr.setConjugationText("plays","present",Parley.Singular,Parley.Third) tr.setConjugationText("play","present",Parley.Plural,Parley.First) tr.setConjugationText("played","past simple",Parley.Singular,Parley.Second)
- Parameters:
-
conjugation The conjugation in tense,number,persontense The tense that conjugationbelongs to (see Document::tenses())number The number of the conjugation. See Parley::Number enumperson The person of the conjugation. See Parley::Person enum
Definition at line 47 of file translation.cpp.
| void Scripting::Translation::setExample | ( | const QString & | expression | ) | [inline] |
Definition at line 102 of file translation.h.
| void Scripting::Translation::setImageUrl | ( | const QString & | url | ) | [inline] |
Definition at line 192 of file translation.h.
| void Scripting::Translation::setParaphrase | ( | const QString & | expression | ) | [inline] |
Definition at line 107 of file translation.h.
| void Scripting::Translation::setPronunciation | ( | const QString & | expression | ) | [inline] |
Definition at line 89 of file translation.h.
| void Scripting::Translation::setSoundUrl | ( | const QString & | url | ) | [inline] |
Definition at line 184 of file translation.h.
| void Scripting::Translation::setSuperlative | ( | const QString & | superlative | ) | [inline] |
Definition at line 171 of file translation.h.
| void Scripting::Translation::setWordType | ( | KEduVocWordType * | wordType | ) | [inline] |
Definition at line 139 of file translation.h.
| QString Scripting::Translation::soundUrl | ( | ) | [inline] |
Definition at line 180 of file translation.h.
| QString Scripting::Translation::superlative | ( | ) | const [inline] |
Definition at line 170 of file translation.h.
| QVariantList Scripting::Translation::synonyms | ( | ) | const [inline, slot] |
Returns synonyms of this expression.
- Returns:
- synonyms (list of Translation objects)
Definition at line 257 of file translation.h.
| QVariantList Scripting::Translation::toVariantList | ( | QList< T * > | objList | ) | const [inline] |
Definition at line 359 of file translation.h.
| QString Scripting::Translation::wordType | ( | ) | const [slot] |
returns the word type of this expression
Definition at line 40 of file translation.cpp.
Property Documentation
QString Scripting::Translation::comment [read, write] |
Comment on this translation.
Definition at line 42 of file translation.h.
QString Scripting::Translation::comparative [read, write] |
Comparative form.
Definition at line 50 of file translation.h.
QString Scripting::Translation::example [read, write] |
Example sentence.
Definition at line 44 of file translation.h.
QString Scripting::Translation::imageUrl [read, write] |
Url of the image file.
Definition at line 56 of file translation.h.
QString Scripting::Translation::paraphrase [read, write] |
Paraphrase.
Definition at line 46 of file translation.h.
QString Scripting::Translation::pronunciation [read, write] |
Word pronunciation.
Definition at line 40 of file translation.h.
QString Scripting::Translation::soundUrl [read, write] |
Url of the sound file.
Definition at line 54 of file translation.h.
QString Scripting::Translation::superlative [read, write] |
Superlative form.
Definition at line 52 of file translation.h.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference