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

kiten/lib

Entry Class Reference

The Entry class is a generic base class for each particular entry in a given dictionary. More...

#include <Entry.h>

Inheritance diagram for Entry:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~Entry ()
virtual Entry * clone () const =0
virtual QString dumpEntry () const =0
virtual bool extendedItemCheck (const QString &key, const QString &value) const
const QString & getDictName () const
const QHash< QString, QString > & getExtendedInfo () const
QString getExtendedInfoItem (const QString &x) const
QString getMeanings () const
QStringList getMeaningsList () const
QString getReadings () const
QStringList getReadingsList () const
QString getWord () const
virtual bool loadEntry (const QString &)=0
virtual bool matchesQuery (const DictQuery &) const
virtual bool sort (const Entry &that, const QStringList &dictionaryList, const QStringList &fieldList) const
virtual bool sortByField (const Entry &that, const QString &field) const
virtual QString toHTML () const
virtual QString toKVTML () const
virtual QString toString () const

Protected Member Functions

 Entry (const QString &sourceDictionary, const QString &word, const QStringList &readings, const QStringList &meanings)
 Entry (const QString &sourceDictionary)
 Entry (const Entry &)
virtual QString HTMLMeanings () const
virtual QString HTMLReadings () const
virtual QString HTMLWord () const
void init ()
bool isKanji (const QChar &) const
bool listMatch (const QStringList &, const QStringList &, DictQuery::MatchType) const
virtual QString makeLink (const QString &) const

Protected Attributes

QHash< QString, QString > ExtendedInfo
QStringList Meanings
QString outputListDelimiter
QStringList Readings
QString sourceDict
QString Word

Detailed Description

The Entry class is a generic base class for each particular entry in a given dictionary.

It's used as the basic class to ferry information back to the user application. It also handles some of the display aspects

Definition at line 38 of file Entry.h.


Constructor & Destructor Documentation

Entry::Entry ( const Entry &  src  )  [protected]

Copy constructor.

Definition at line 63 of file Entry.cpp.

Entry::Entry ( const QString &  sourceDictionary  )  [protected]

Constructor that includes the dictionary source.

This does not need to be overridded by subclasses, but you might find it to be convenient as the superclass constructor to call from your constructors.

Parameters:
sourceDictionary the dictionary name (not fileName) that this entry originated with

Definition at line 47 of file Entry.cpp.

Entry::Entry ( const QString &  sourceDictionary,
const QString &  word,
const QStringList &  readings,
const QStringList &  meanings 
) [protected]

A constructor that includes the basic information, nicely separated.

Parameters:
sourceDictionary the dictionary name (not fileName) that this entry originated with
word the word entry of this dictionary entry (normally kanji/kana)
readings a list of possible pronunciations for this result (kana)
meanings a list of possible meanings for this word

Definition at line 53 of file Entry.cpp.

Entry::~Entry (  )  [virtual]

Generic Destructor.

Definition at line 77 of file Entry.cpp.


Member Function Documentation

virtual Entry* Entry::clone (  )  const [pure virtual]

A clone method, this should just implement "return new EntrySubClass(*this)".

Implemented in entryDeinflect, EntryEDICT, and EntryKanjidic.

virtual QString Entry::dumpEntry (  )  const [pure virtual]

Return a QString of an entry, as if it were dumped back into it's source file.

Implemented in entryDeinflect, EntryEDICT, and EntryKanjidic.

bool Entry::extendedItemCheck ( const QString &  key,
const QString &  value 
) const [virtual]

Simple accessor.

Parameters:
key the key for the extended item that is being verified
value the value it is supposed to have
Returns:
true if the key has that value, false if it is different or does not exist

Reimplemented in EntryKanjidic.

Definition at line 223 of file Entry.cpp.

const QString & Entry::getDictName (  )  const

Get the dictionary name that generated this Entry.

I can't think of a reason to be changing this.

Definition at line 83 of file Entry.cpp.

const QHash< QString, QString > & Entry::getExtendedInfo (  )  const

Simple accessor.

Definition at line 96 of file Entry.cpp.

QString Entry::getExtendedInfoItem ( const QString &  x  )  const

Simple accessor.

Parameters:
x the key for the extended info item to get

Definition at line 99 of file Entry.cpp.

QString Entry::getMeanings (  )  const

Get a QString containing all of the meanings known, connected by the outputListDelimiter.

Definition at line 88 of file Entry.cpp.

QStringList Entry::getMeaningsList (  )  const

Simple accessor.

Definition at line 90 of file Entry.cpp.

QString Entry::getReadings (  )  const

Simple accessor.

Definition at line 92 of file Entry.cpp.

QStringList Entry::getReadingsList (  )  const

Simple accessor.

Definition at line 94 of file Entry.cpp.

QString Entry::getWord (  )  const

Get the word from this Entry.

If the entry is of type kanji/kana/meaning/etc, this will return the kanji. If it is of kana/meaning/etc, it will return kana

Definition at line 86 of file Entry.cpp.

QString Entry::HTMLMeanings (  )  const [inline, protected, virtual]

Return and HTML version of a meaning list.

Definition at line 162 of file Entry.cpp.

QString Entry::HTMLReadings (  )  const [inline, protected, virtual]

Return and HTML version of a reading list.

Reimplemented in EntryKanjidic.

Definition at line 152 of file Entry.cpp.

QString Entry::HTMLWord (  )  const [inline, protected, virtual]

Return and HTML version of a word.

Reimplemented in EntryEDICT, and EntryKanjidic.

Definition at line 146 of file Entry.cpp.

void Entry::init (  )  [protected]

This is used by the constructors to set some default values.

Definition at line 73 of file Entry.cpp.

bool Entry::isKanji ( const QChar &  character  )  const [protected]

Handy Utility functions for matching to lists and identifying char types.

Definition at line 122 of file Entry.cpp.

bool Entry::listMatch ( const QStringList &  list,
const QStringList &  test,
DictQuery::MatchType  type 
) const [protected]

Handy Utility functions for matching to lists and identifying char types.

Definition at line 230 of file Entry.cpp.

virtual bool Entry::loadEntry ( const QString &   )  [pure virtual]

An entry should be able to parse an in-file representation of an entry as a QString and put it back.

The latter will be useful for writing to dictionaries on disk at some point.

Implemented in entryDeinflect, EntryEDICT, and EntryKanjidic.

QString Entry::makeLink ( const QString &  entryString  )  const [inline, protected, virtual]

Handy function for generating a link from a given QString.

Definition at line 116 of file Entry.cpp.

bool Entry::matchesQuery ( const DictQuery &  query  )  const [virtual]

Fairly important method, this tests if this particular entry matches a query.

The EDICT and Kanjidic doSearch methods do an approximate match, load an Entry, and then check more carefully by calling this method. This works nicely for handling searchWithinResults cleanly

Reimplemented in entryDeinflect.

Definition at line 168 of file Entry.cpp.

bool Entry::sort ( const Entry &  that,
const QStringList &  dictionaryList,
const QStringList &  fieldList 
) const [virtual]

An overrideable sorting function, similer to operator< in most contexts The default version will sort by dictionary, then by fields.

Parameters:
that the second item we are comparing (this) with
dictionaryList the list of dictionaries (in order) to sort If this list is empty, the entries will not be sorted in order
fieldList the list of fields to sort in, uses special codes of Reading, Meaning, Word/Kanji for those elements, all others by their extended attribute keys.

Definition at line 266 of file Entry.cpp.

bool Entry::sortByField ( const Entry &  that,
const QString &  field 
) const [virtual]

Overrideable sorting mechanism for sorting by individual fields.

The sort routine checks if the given field is equal, before calling this virtual function So if this is called, you can assume that this->extendedItem(field) != that.extendedItem(field)

Parameters:
that the second item we are comparing (this) with
field the specific extended item field that is being compared

Definition at line 303 of file Entry.cpp.

QString Entry::toHTML (  )  const [virtual]

An entry should be able to generate a representation of itself in (valid) HTML.

Main switching function for displaying to the user.

Reimplemented in entryDeinflect, EntryEDICT, and EntryKanjidic.

Definition at line 102 of file Entry.cpp.

QString Entry::toKVTML (  )  const [inline, virtual]

KVTML format for exporting.

Definition at line 131 of file Entry.cpp.

QString Entry::toString (  )  const [virtual]

This will return a pure text interpretation of the Entry.

This method should return the entry object in a simple QString format Brief form should be useable in quick summaries, for example Verbose form might be used to save a complete list of entries to a file, for example.

Definition at line 110 of file Entry.cpp.


Member Data Documentation

QHash<QString,QString> Entry::ExtendedInfo [protected]

A hash of extended information.

You may find it useful to store all sorts of details here

Definition at line 141 of file Entry.h.

QStringList Entry::Meanings [protected]

The Meanings that match this entry.

If you override the accessors above, this has no use

Definition at line 136 of file Entry.h.

QString Entry::outputListDelimiter [protected]

The delimiter for lists.

.. usually space

Definition at line 146 of file Entry.h.

QStringList Entry::Readings [protected]

The Readings (usually kana) that match this entry.

If you override the accessors above, this has no use

Definition at line 139 of file Entry.h.

QString Entry::sourceDict [protected]

The dictionary that this entry originated at.

Definition at line 144 of file Entry.h.

QString Entry::Word [protected]

The Word (usually containing kanji) that matches this entry.

If you override the accessors above, this has no use

Definition at line 133 of file Entry.h.


The documentation for this class was generated from the following files:
  • Entry.h
  • Entry.cpp

kiten/lib

Skip menu "kiten/lib"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  •     lib
  • kalzium
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  •   stepcore
Generated for kdeedu by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal