• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

parley

  • Scripting
  • Translation
Public Slots | Public Member Functions | Properties | List of all members
Scripting::Translation Class Reference

#include <translation.h>

Inheritance diagram for Scripting::Translation:
Inheritance graph
[legend]

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)
 
QStringList conjugationTexts (const QString &tense, const KEduVocWordFlags &flags)
 
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 Slots inherited from Scripting::Text
void decGrade ()
 
void incBadCount ()
 
void incGrade ()
 
void incPracticeCount ()
 
QString practiceDate () const
 
QString practiceDate (const QString &format) const
 
void resetGrades ()
 
void setPracticeDate (const QString &date)
 
void setPracticeDate (const QString &date, const QString &format)
 

Public Member Functions

 Translation (Expression *entry)
 
 Translation (Expression *entry, const QString &translation)
 
 Translation (KEduVocTranslation *translation)
 
 ~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
 
- Public Member Functions inherited from Scripting::Text
 Text (const QString &text=QString())
 
 Text (KEduVocText *text)
 
 Text (const KEduVocText &text)
 
 ~Text ()
 
unsigned int badCount () const
 
unsigned int grade () const
 
bool isEmpty ()
 
KEduVocText * kEduVocText ()
 
unsigned int practiceCount () const
 
void setBadCount (unsigned int count)
 
void setGrade (unsigned int grade)
 
void setPracticeCount (unsigned int count)
 
void setText (const QString &expr)
 
QString text () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Properties

QString comment
 
QString comparative
 
QString example
 
QString imageUrl
 
QString paraphrase
 
QString pronunciation
 
QString soundUrl
 
QString superlative
 
- Properties inherited from Scripting::Text
unsigned int badCount
 
unsigned int grade
 
bool isEmpty
 
unsigned int practiceCount
 
QString text
 
- Properties inherited from QObject
 objectName
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Protected Attributes inherited from Scripting::Text
KEduVocText * m_text
 

Detailed Description

KEduVocTranslation wrapper class for scripting with Kross.

Author
Avgoustinos Kadis avgou.nosp@m.stin.nosp@m.os.ka.nosp@m.dis@.nosp@m.kdema.nosp@m.il.n.nosp@m.et

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)
inlineslot

Add a antonym.

Parameters
antonymAn excisting translation object that contains the antonym

Definition at line 283 of file translation.h.

void Scripting::Translation::addFalseFriend ( Translation *  falseFriend)
inlineslot

Add a false friend.

Parameters
falseFriendfalse friend of this index

Definition at line 251 of file translation.h.

void Scripting::Translation::addSynonym ( Translation *  synonym)
inlineslot

Add a synonym.

Parameters
synonymAn excisting translation object that contains the synonym

Definition at line 267 of file translation.h.

QVariantList Scripting::Translation::antonyms ( ) const
inlineslot

Returns antonyms of this expression.

Returns
antonyms (list of Translation objects)

Definition at line 315 of file translation.h.

QString Scripting::Translation::comment ( ) const
inline

Definition at line 98 of file translation.h.

QString Scripting::Translation::comparative ( ) const
inline

Definition at line 188 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
tenseThe conjugation tense (see Document::tenses())
numberThe conjugation number. See Parley::Number enum
personThe 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
inlineslot

returns a string list with the available conjugation tenses

Definition at line 328 of file translation.h.

QStringList Scripting::Translation::conjugationTexts ( const QString &  tense)
slot

Returns all the possible conjugations of the given tense.

Parameters
tenseThe 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.

QStringList Scripting::Translation::conjugationTexts ( const QString &  tense,
const KEduVocWordFlags &  flags 
)
slot

Returns the conjugations of the given tense and number.

Parameters
tenseThe tense of conjugation
numberConjugation number. See Parley::Number enum
Returns
A String list with 5 conjugations in the order of [First, Second, ThirdMale, ThirdFemale, Third]

Definition at line 85 of file translation.cpp.

QString Scripting::Translation::example ( ) const
inline

Definition at line 109 of file translation.h.

QVariantList Scripting::Translation::falseFriends ( ) const
inlineslot

Returns false friends of this expression.

Returns
list of false friends (list of Translation objects)

Definition at line 299 of file translation.h.

QString Scripting::Translation::imageUrl ( )
inline

Definition at line 219 of file translation.h.

KEduVocTranslation* Scripting::Translation::kEduVocTranslation ( )
inline

Definition at line 77 of file translation.h.

QStringList Scripting::Translation::multipleChoice ( )
inlineslot

returns multiple choice if available

Definition at line 323 of file translation.h.

QString Scripting::Translation::paraphrase ( ) const
inline

Definition at line 128 of file translation.h.

QString Scripting::Translation::pronunciation ( ) const
inline

Definition at line 89 of file translation.h.

void Scripting::Translation::removeAntonym ( Translation *  antonym)
inlineslot

Remove a antonym.

Parameters
antonymAn excisting translation object that contains the synonym

Definition at line 291 of file translation.h.

void Scripting::Translation::removeFalseFriend ( Translation *  falseFriend)
inlineslot

Remove a false friend.

Parameters
falseFriendfalse friend of this index

Definition at line 259 of file translation.h.

void Scripting::Translation::removeSynonym ( Translation *  synonym)
inlineslot

Remove a synonym.

Parameters
synonymAn excisting translation object that contains the synonym

Definition at line 275 of file translation.h.

void Scripting::Translation::setComment ( const QString &  expr)
inline

Definition at line 102 of file translation.h.

void Scripting::Translation::setComparative ( const QString &  comparative)
inline

Definition at line 191 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
conjugationScripting::Text object as the conjugation
tenseThe tense that conjugation belongs to (see Document::tenses())
numberThe number of the conjugation. See Parley::Number enum
personThe 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
conjugationThe conjugation in tense, number, person
tenseThe tense that conjugation belongs to (see Document::tenses())
numberThe number of the conjugation. See Parley::Number enum
personThe 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 114 of file translation.h.

void Scripting::Translation::setImageUrl ( const QString &  url)
inline

Definition at line 226 of file translation.h.

void Scripting::Translation::setParaphrase ( const QString &  expression)
inline

Definition at line 121 of file translation.h.

void Scripting::Translation::setPronunciation ( const QString &  expression)
inline

Definition at line 93 of file translation.h.

void Scripting::Translation::setSoundUrl ( const QString &  url)
inline

Definition at line 214 of file translation.h.

void Scripting::Translation::setSuperlative ( const QString &  superlative)
inline

Definition at line 197 of file translation.h.

void Scripting::Translation::setWordType ( KEduVocWordType *  wordType)
inline

Definition at line 157 of file translation.h.

QString Scripting::Translation::soundUrl ( )
inline

Definition at line 208 of file translation.h.

QString Scripting::Translation::superlative ( ) const
inline

Definition at line 194 of file translation.h.

QVariantList Scripting::Translation::synonyms ( ) const
inlineslot

Returns synonyms of this expression.

Returns
synonyms (list of Translation objects)

Definition at line 307 of file translation.h.

template<class T , class S >
QVariantList Scripting::Translation::toVariantList ( QList< T * >  objList) const

Definition at line 417 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
readwrite

Comment on this translation.

Definition at line 42 of file translation.h.

QString Scripting::Translation::comparative
readwrite

Comparative form.

Definition at line 50 of file translation.h.

QString Scripting::Translation::example
readwrite

Example sentence.

Definition at line 44 of file translation.h.

QString Scripting::Translation::imageUrl
readwrite

Url of the image file.

Definition at line 56 of file translation.h.

QString Scripting::Translation::paraphrase
readwrite

Paraphrase.

Definition at line 46 of file translation.h.

QString Scripting::Translation::pronunciation
readwrite

Word pronunciation.

Definition at line 40 of file translation.h.

QString Scripting::Translation::soundUrl
readwrite

Url of the sound file.

Definition at line 54 of file translation.h.

QString Scripting::Translation::superlative
readwrite

Superlative form.

Definition at line 52 of file translation.h.


The documentation for this class was generated from the following files:
  • translation.h
  • translation.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

parley

Skip menu "parley"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal