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

kiten/lib

  • sources
  • kde-4.14
  • kdeedu
  • kiten
  • lib
  • DictEdict
entryedict.cpp
Go to the documentation of this file.
1 /*****************************************************************************
2  * This file is part of Kiten, a KDE Japanese Reference Tool *
3  * Copyright (C) 2006 Joseph Kerian <jkerian@gmail.com> *
4  * Copyright (C) 2006 Eric Kjeldergaard <kjelderg@gmail.com> *
5  * Copyright (C) 2011 Daniel E. Moctezuma <democtezuma@gmail.com> *
6  * *
7  * This library is free software; you can redistribute it and/or *
8  * modify it under the terms of the GNU Library General Public *
9  * License as published by the Free Software Foundation; either *
10  * version 2 of the License, or (at your option) any later version. *
11  * *
12  * This library is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15  * Library General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU Library General Public License *
18  * along with this library; see the file COPYING.LIB. If not, write to *
19  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
20  * Boston, MA 02110-1301, USA. *
21  *****************************************************************************/
22 
23 #include "entryedict.h"
24 
25 #include "dictfileedict.h"
26 #include "kitenmacros.h"
27 
28 #include <KDebug>
29 #include <KLocalizedString>
30 
31 #define QSTRINGLISTCHECK(x) (x==NULL?QStringList():*x)
32 
33 EntryEdict::EntryEdict( const QString &dict )
34 : Entry( dict )
35 {
36 }
37 
38 EntryEdict::EntryEdict( const QString &dict, const QString &entry )
39 : Entry( dict )
40 {
41  loadEntry( entry );
42 }
43 
44 Entry* EntryEdict::clone() const
45 {
46  return new EntryEdict( *this );
47 }
48 
52 QString EntryEdict::dumpEntry() const
53 {
54  QString readings = QString( Readings.count() == 0 ? " " : " [" + Readings.first() + "] " );
55 
56  return QString( "%1%2/%3/" ).arg( Word )
57  .arg( readings )
58  .arg( Meanings.join( "/" ) );
59 }
60 
61 QString EntryEdict::getDictionaryType() const
62 {
63  return EDICT;
64 }
65 
66 QString EntryEdict::getTypes() const
67 {
68  return m_types.join( outputListDelimiter );
69 }
70 
71 QStringList EntryEdict::getTypesList() const
72 {
73  return m_types;
74 }
75 
76 bool EntryEdict::isAdjective() const
77 {
78  foreach( const QString &type, EdictFormatting::Adjectives )
79  {
80  if( m_types.contains( type ) )
81  {
82  return true;
83  }
84  }
85 
86  return false;
87 }
88 
89 bool EntryEdict::isAdverb() const
90 {
91  foreach( const QString &type, EdictFormatting::Adverbs )
92  {
93  if( m_types.contains( type ) )
94  {
95  return true;
96  }
97  }
98 
99  return false;
100 }
101 
102 bool EntryEdict::isCommon() const
103 {
104  return getExtendedInfoItem( QString( "common" ) ) == "1";
105 }
106 
107 bool EntryEdict::isExpression() const
108 {
109  foreach( const QString &type, EdictFormatting::Expressions )
110  {
111  if( m_types.contains( type ) )
112  {
113  return true;
114  }
115  }
116 
117  return false;
118 }
119 
120 bool EntryEdict::isFukisokuVerb() const
121 {
122  foreach( const QString &type, EdictFormatting::FukisokuVerbs )
123  {
124  if( m_types.contains( type ) )
125  {
126  return true;
127  }
128  }
129 
130  return false;
131 }
132 
133 bool EntryEdict::isGodanVerb() const
134 {
135  foreach( const QString &type, EdictFormatting::GodanVerbs )
136  {
137  if( m_types.contains( type ) )
138  {
139  return true;
140  }
141  }
142 
143  return false;
144 }
145 
146 bool EntryEdict::isIchidanVerb() const
147 {
148  foreach( const QString &type, EdictFormatting::IchidanVerbs )
149  {
150  if( m_types.contains( type ) )
151  {
152  return true;
153  }
154  }
155 
156  return false;
157 }
158 
159 bool EntryEdict::isNoun() const
160 {
161  foreach( const QString &type, EdictFormatting::Nouns )
162  {
163  if( m_types.contains( type ) )
164  {
165  return true;
166  }
167  }
168 
169  return false;
170 }
171 
172 bool EntryEdict::isParticle() const
173 {
174  return m_types.contains( EdictFormatting::Particle );
175 }
176 
177 bool EntryEdict::isPrefix() const
178 {
179  foreach( const QString &type, EdictFormatting::Prefix )
180  {
181  if( m_types.contains( type ) )
182  {
183  return true;
184  }
185  }
186 
187  return false;
188 }
189 
190 bool EntryEdict::isSuffix() const
191 {
192  foreach( const QString &type, EdictFormatting::Suffix )
193  {
194  if( m_types.contains( type ) )
195  {
196  return true;
197  }
198  }
199 
200  return false;
201 }
202 
203 bool EntryEdict::isVerb() const
204 {
205  foreach( const QString &type, EdictFormatting::Verbs )
206  {
207  if( m_types.contains( type ) )
208  {
209  return true;
210  }
211  }
212 
213  return false;
214 }
215 
216 QString EntryEdict::HTMLWord() const
217 {
218  return QString( "<span class=\"Word\">%1</span>" )
219  .arg( Word.isEmpty() ? kanjiLinkify( Meanings.first() ) : kanjiLinkify( Word ) );
220 }
221 
225 QString EntryEdict::kanjiLinkify( const QString &inString ) const
226 {
227  QString outString;
228 
229  for( int i = 0; i < inString.length(); i++ )
230  {
231  if( isKanji( inString.at( i ) ) )
232  {
233  outString += makeLink( QString( inString.at( i ) ) );
234  }
235  else
236  {
237  outString += inString.at( i );
238  }
239  }
240 
241  return outString;
242 }
243 
250 bool EntryEdict::loadEntry( const QString &entryLine )
251 {
252  /* Set tempQString to be the reading and word portion of the entryLine */
253  int endOfKanjiAndKanaSection = entryLine.indexOf( '/' );
254  if( endOfKanjiAndKanaSection == -1 )
255  {
256  return false;
257  }
258  QString tempQString = entryLine.left( endOfKanjiAndKanaSection );
259  /* The actual Word is the beginning of the line */
260  int endOfKanji = tempQString.indexOf( ' ' );
261  if( endOfKanji == -1 )
262  {
263  return false;
264  }
265  Word = tempQString.left( endOfKanji );
266 
267  /* The Reading is either Word or encased in '[' */
268  Readings.clear();
269  int startOfReading = tempQString.indexOf( '[' );
270  if( startOfReading != -1 ) // This field is optional for EDICT (and kiten)
271  {
272  Readings.append( tempQString.left( tempQString.lastIndexOf( ']' ) ).mid( startOfReading + 1 ) );
273  }
274  /* TODO: use this code or not?
275  * app does not handle only reading and no word entries
276  * very well so far
277  else
278  {
279  Readings.append(Word);
280  Word.clear();
281  }
282  */
283 
284  /* set Meanings to be all of the meanings in the definition */
285  QString remainingLine = entryLine.mid( endOfKanjiAndKanaSection );
286  //Trim to last '/'
287  remainingLine = remainingLine.left( remainingLine.lastIndexOf( '/' ) );
288  Meanings = remainingLine.split( '/', QString::SkipEmptyParts );
289 
290  if( Meanings.size() == 0 )
291  {
292  return false;
293  }
294 
295  if( Meanings.last() == "(P)" )
296  {
297  ExtendedInfo[ QString( "common" ) ] = "1";
298  Meanings.removeLast();
299  }
300 
301  QString firstWord = Meanings.first();
302  QStringList stringTypes;
303 
304  //Pulls the various types out
305  //TODO: Remove them from the original string
306  for ( int i = firstWord.indexOf( "(" );
307  i != -1;
308  i = firstWord.indexOf( "(", i + 1 ) )
309  {
310  QString parantheses = firstWord.mid( i + 1, firstWord.indexOf( ")", i ) - i - 1 );
311  stringTypes += parantheses.split( ',' );
312  }
313 
314  foreach( const QString &str, stringTypes )
315  {
316  if( EdictFormatting::PartsOfSpeech.contains( str ) )
317  {
318  m_types += str;
319  }
320  else if( EdictFormatting::FieldOfApplication.contains( str ) )
321  {
322  ExtendedInfo[ "field" ] = str;
323  }
324  else if( EdictFormatting::MiscMarkings.contains( str ) )
325  {
326  m_miscMarkings += str;
327  }
328  }
329 
330  return true;
331 }
332 
333 bool EntryEdict::matchesWordType( const DictQuery &query ) const
334 {
335  if( ! query.isEmpty() )
336  {
337  if( query.getMatchWordType() == DictQuery::Verb
338  && isVerb() )
339  {
340  return true;
341  }
342  if( query.getMatchWordType() == DictQuery::Noun
343  && isNoun() )
344  {
345  return true;
346  }
347  if( query.getMatchWordType() == DictQuery::Adjective
348  && isAdjective() )
349  {
350  return true;
351  }
352  if( query.getMatchWordType() == DictQuery::Adverb
353  && isAdverb() )
354  {
355  return true;
356  }
357  if( query.getMatchWordType() == DictQuery::Expression
358  && isExpression() )
359  {
360  return true;
361  }
362  if( query.getMatchWordType() == DictQuery::Prefix
363  && isPrefix() )
364  {
365  return true;
366  }
367  if( query.getMatchWordType() == DictQuery::Suffix
368  && isSuffix() )
369  {
370  return true;
371  }
372  if( query.getMatchWordType() == DictQuery::Any )
373  {
374  return true;
375  }
376  }
377 
378  return false;
379 }
380 
384 QString EntryEdict::toHTML() const
385 {
386  QString result = QString( "<div class=\"%1\">" ).arg( EDICT.toUpper() );
387  if( isCommon() )
388  {
389  result += "<div class=\"Common\">";
390  }
391 
392  foreach( const QString &field, QSTRINGLISTCHECK( DictFileEdict::displayFields ) )
393  {
394  if( field == "--NewLine--" ) result += "<br>";
395  else if( field == "Word/Kanji" ) result += HTMLWord()+' ';
396  else if( field == "Meaning" ) result += HTMLMeanings()+' ';
397  else if( field == "Reading" ) result += HTMLReadings()+' ';
398  else kDebug() << "Unknown field: " << field;
399  }
400 
401  if( isCommon() )
402  {
403  result += "</div>";
404  }
405 
406  result += "</div>";
407  return result;
408 }
409 
410 
411 
412 #ifdef KITEN_EDICTFORMATTING
413 
440 namespace EdictFormatting
441 {
442  // Forward declarations of our functions to be used.
443  QMultiHash<QString, QString> createPartOfSpeechCategories();
444  QSet<QString> createPartsOfSpeech();
445  QSet<QString> createMiscMarkings();
446  QSet<QString> createFieldOfApplication();
447  QStringList createNounsList();
448  QStringList createVerbsList();
449  QStringList createExpressionsList();
450  QStringList createPrefixesList();
451  QStringList createSuffixesList();
452 
453  // Private variables.
454  QString noun = QString( i18nc( "This must be a single word", "Noun" ) );
455  QString verb = QString( i18nc( "This must be a single word", "Verb" ) );
456  QString adjective = QString( i18nc( "This must be a single word", "Adjective" ) );
457  QString adverb = QString( i18nc( "This must be a single word", "Adverb" ) );
458  QString particle = QString( i18nc( "This must be a single word", "Particle" ) );
459  QString ichidanVerb = QString( i18nc( "This is a technical japanese linguist's term... and probably should not be translated (except possibly in far-eastern languages), this must be a single word", "Ichidan" ) );
460  QString godanVerb = QString( i18nc( "This is a technical japanese linguist's term... and probably should not be translated, this must be a single word", "Godan" ) );
461  QString fukisokuVerb = QString( i18nc( "This is a technical japanese linguist's term... and probably should not be translated, this must be a single word", "Fukisoku" ) );
462  QString expression = QString( i18n( "Expression" ) );
463  QString idiomaticExpression = QString( i18n( "Idiomatic expression" ) );
464  QString prefix = QString( i18n( "Prefix" ) );
465  QString suffix = QString( i18n( "Suffix" ) );
466  QString nounPrefix = QString( i18n( "Noun (used as a prefix)" ) );
467  QString nounSuffix = QString( i18n( "Noun (used as a suffix)" ) );
468 
469 
470  // Define our public variables.
471  QMultiHash<QString, QString> PartOfSpeechCategories = createPartOfSpeechCategories();
472  QSet<QString> PartsOfSpeech = createPartsOfSpeech();
473  QSet<QString> MiscMarkings = createMiscMarkings();
474  QSet<QString> FieldOfApplication = createFieldOfApplication();
475 
476  // PartOfSpeechCategories needs to has some values before this line.
477  QStringList Nouns = createNounsList();
478  QStringList Adjectives = PartOfSpeechCategories.values( adjective );
479  QStringList Adverbs = PartOfSpeechCategories.values( adverb );
480  QStringList IchidanVerbs = PartOfSpeechCategories.values( ichidanVerb );
481  QStringList GodanVerbs = PartOfSpeechCategories.values( godanVerb );
482  QStringList FukisokuVerbs = PartOfSpeechCategories.values( fukisokuVerb );
483  QStringList Verbs = createVerbsList();
484  QStringList Expressions = createExpressionsList();
485  QStringList Prefix = createPrefixesList();
486  QStringList Suffix = createSuffixesList();
487  QString Particle = PartOfSpeechCategories.value( particle );
488 
489 
490 
491  QStringList createNounsList()
492  {
493  QStringList list;
494  list.append( PartOfSpeechCategories.values( noun ) );
495  list.append( PartOfSpeechCategories.values( nounPrefix ) );
496  list.append( PartOfSpeechCategories.values( nounSuffix ) );
497  return list;
498  }
499 
500  QStringList createVerbsList()
501  {
502  QStringList list;
503  list.append( PartOfSpeechCategories.values( verb ) );
504  list.append( IchidanVerbs );
505  list.append( GodanVerbs );
506  list.append( FukisokuVerbs );
507  return list;
508  }
509 
510  QStringList createExpressionsList()
511  {
512  QStringList list;
513  list.append( PartOfSpeechCategories.values( expression ) );
514  list.append( PartOfSpeechCategories.values( idiomaticExpression ) );
515  return list;
516  }
517 
518  QStringList createPrefixesList()
519  {
520  QStringList list;
521  list.append( PartOfSpeechCategories.values( prefix ) );
522  list.append( PartOfSpeechCategories.values( nounPrefix ) );
523  return list;
524  }
525 
526  QStringList createSuffixesList()
527  {
528  QStringList list;
529  list.append( PartOfSpeechCategories.values( suffix ) );
530  list.append( PartOfSpeechCategories.values( nounSuffix ) );
531  return list;
532  }
533 
534  QMultiHash<QString, QString> createPartOfSpeechCategories()
535  {
536  QMultiHash<QString, QString> categories;
537 
538  // Nouns
539  categories.insert( noun, "n" );
540  categories.insert( noun, "n-adv" );
541  categories.insert( noun, "n-t" );
542  categories.insert( noun, "adv-n" );
543 
544  // Noun (used as a prefix)
545  categories.insert( nounPrefix, "n-pref" );
546 
547  // Noun (used as a suffix)
548  categories.insert( nounSuffix, "n-suf" );
549 
550  // Ichidan Verbs
551  categories.insert( ichidanVerb, "v1" );
552  categories.insert( ichidanVerb, "vz" );
553 
554  // Godan Verbs
555  categories.insert( godanVerb, "v5" );
556  categories.insert( godanVerb, "v5aru" );
557  categories.insert( godanVerb, "v5b" );
558  categories.insert( godanVerb, "v5g" );
559  categories.insert( godanVerb, "v5k" );
560  categories.insert( godanVerb, "v5k-s" );
561  categories.insert( godanVerb, "v5m" );
562  categories.insert( godanVerb, "v5n" );
563  categories.insert( godanVerb, "v5r" );
564  categories.insert( godanVerb, "v5r-i" );
565  categories.insert( godanVerb, "v5s" );
566  categories.insert( godanVerb, "v5t" );
567  categories.insert( godanVerb, "v5u" );
568  categories.insert( godanVerb, "v5u-s" );
569  categories.insert( godanVerb, "v5uru" );
570  categories.insert( godanVerb, "v5z" );
571 
572  // Fukisoku verbs
573  categories.insert( fukisokuVerb, "iv" );
574  categories.insert( fukisokuVerb, "vk" );
575  categories.insert( fukisokuVerb, "vn" );
576  categories.insert( fukisokuVerb, "vs-i" );
577  categories.insert( fukisokuVerb, "vs-s" );
578 
579  // Other Verbs
580  categories.insert( verb, "vi" );
581  categories.insert( verb, "vs" );
582  categories.insert( verb, "vt" );
583  categories.insert( verb, "aux-v" );
584 
585  // Adjectives
586  categories.insert( adjective, "adj-i" );
587  categories.insert( adjective, "adj-na" );
588  categories.insert( adjective, "adj-no" );
589  categories.insert( adjective, "adj-pn" );
590  categories.insert( adjective, "adj-t" );
591  categories.insert( adjective, "adj-f" );
592  categories.insert( adjective, "adj" );
593  categories.insert( adjective, "aux-adj" );
594 
595  // Adverbs
596  categories.insert( adverb, "adv" );
597  categories.insert( adverb, "adv-n" );
598  categories.insert( adverb, "adv-to" );
599 
600  // Particle
601  categories.insert( particle, "prt" );
602 
603  // Expression
604  categories.insert( expression, "exp" );
605 
606  // Idiomatic expression
607  categories.insert( idiomaticExpression, "id" );
608 
609  // Prefix
610  categories.insert( prefix, "pref" );
611 
612  // Suffix
613  categories.insert( suffix, "suf" );
614 
615  return categories;
616  }
617 
618  QSet<QString> createPartsOfSpeech()
619  {
620  QSet<QString> category;
621 
622  category << "adj-i" << "adj-na" << "adj-no" << "adj-pn" << "adj-t" << "adj-f"
623  << "adj" << "adv" << "adv-n" << "adv-to" << "aux" << "aux-v"
624  << "aux-adj" << "conj" << "ctr" << "exp" << "id" << "int"
625  << "iv" << "n" << "n-adv" << "n-pref" << "n-suf" << "n-t"
626  << "num" << "pn" << "pref" << "prt" << "suf" << "v1"
627  << "v5" << "v5aru" << "v5b" << "v5g" << "v5k" << "v5k-s"
628  << "v5m" << "v5n" << "v5r" << "v5r-i" << "v5s" << "v5t"
629  << "v5u" << "v5u-s" << "v5uru" << "v5z" << "vz" << "vi"
630  << "vk" << "vn" << "vs" << "vs-i" << "vs-s" << "vt";
631 
632  return category;
633  }
634 
635  QSet<QString> createFieldOfApplication()
636  {
637  QSet<QString> category;
638 
639  // Field of Application terms
640  category << "Buddh" << "MA" << "comp" << "food" << "geom"
641  << "ling" << "math" << "mil" << "physics";
642 
643  return category;
644  }
645 
646  QSet<QString> createMiscMarkings()
647  {
648  QSet<QString> category;
649 
650  // Miscellaneous Markings (in EDICT terms)
651  category << "X" << "abbr" << "arch" << "ateji" << "chn" << "col" << "derog"
652  << "eK" << "ek" << "fam" << "fem" << "gikun" << "hon" << "hum" << "iK" << "id"
653  << "io" << "m-sl" << "male" << "male-sl" << "ng" << "oK" << "obs" << "obsc" << "ok"
654  << "poet" << "pol" << "rare" << "sens" << "sl" << "uK" << "uk" << "vulg";
655 
656  return category;
657  }
658 }
659 
660 #endif
EntryEdict::getDictionaryType
virtual QString getDictionaryType() const
Get the dictionary type (e.g.
Definition: entryedict.cpp:61
DictQuery::Any
Definition: dictquery.h:307
EntryEdict::isIchidanVerb
bool isIchidanVerb() const
Definition: entryedict.cpp:146
EdictFormatting::createExpressionsList
QStringList createExpressionsList()
Definition: entryedict.cpp:510
QList::clear
void clear()
EntryEdict::isGodanVerb
bool isGodanVerb() const
Definition: entryedict.cpp:133
EdictFormatting::idiomaticExpression
QString idiomaticExpression
Definition: entryedict.cpp:463
QString::indexOf
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
EntryEdict::isExpression
bool isExpression() const
Definition: entryedict.cpp:107
EdictFormatting::createSuffixesList
QStringList createSuffixesList()
Definition: entryedict.cpp:526
EdictFormatting::createFieldOfApplication
QSet< QString > createFieldOfApplication()
Definition: entryedict.cpp:635
EntryEdict::getTypes
QString getTypes() const
Simple accessor.
Definition: entryedict.cpp:66
EntryEdict::isPrefix
bool isPrefix() const
Definition: entryedict.cpp:177
DictQuery::isEmpty
bool isEmpty() const
Definition: dictquery.cpp:111
EdictFormatting::IchidanVerbs
QStringList IchidanVerbs
Definition: entryedict.cpp:480
EdictFormatting::verb
QString verb
Definition: entryedict.cpp:455
Entry
The Entry class is a generic base class for each particular entry in a given dictionary.
Definition: entry.h:44
EntryEdict::matchesWordType
bool matchesWordType(const DictQuery &query) const
Definition: entryedict.cpp:333
QString::split
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
EDICT
#define EDICT
Definition: kitenmacros.h:24
EntryEdict::HTMLWord
virtual QString HTMLWord() const
Return and HTML version of a word.
Definition: entryedict.cpp:216
QStringList::contains
bool contains(const QString &str, Qt::CaseSensitivity cs) const
EdictFormatting::createVerbsList
QStringList createVerbsList()
Definition: entryedict.cpp:500
EdictFormatting::fukisokuVerb
QString fukisokuVerb
Definition: entryedict.cpp:461
QStringList::join
QString join(const QString &separator) const
DictQuery::Adverb
Definition: dictquery.h:311
Entry::HTMLMeanings
virtual QString HTMLMeanings() const
Return and HTML version of a meaning list.
Definition: entry.cpp:158
DictQuery::Adjective
Definition: dictquery.h:310
EdictFormatting::createMiscMarkings
QSet< QString > createMiscMarkings()
Definition: entryedict.cpp:646
Entry::HTMLReadings
virtual QString HTMLReadings() const
Return and HTML version of a reading list.
Definition: entry.cpp:165
EdictFormatting::createPartOfSpeechCategories
QMultiHash< QString, QString > createPartOfSpeechCategories()
Definition: entryedict.cpp:534
EntryEdict::isSuffix
bool isSuffix() const
Definition: entryedict.cpp:190
EdictFormatting::createNounsList
QStringList createNounsList()
Definition: entryedict.cpp:491
QList::size
int size() const
QString::lastIndexOf
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
entryedict.h
Entry::Readings
QStringList Readings
The Readings (usually kana) that match this entry.
Definition: entry.h:203
EntryEdict::isAdjective
bool isAdjective() const
Definition: entryedict.cpp:76
EdictFormatting::createPartsOfSpeech
QSet< QString > createPartsOfSpeech()
Definition: entryedict.cpp:618
Entry::makeLink
virtual QString makeLink(const QString &entryString) const
Handy function for generating a link from a given QString.
Definition: entry.cpp:289
EdictFormatting::Adjectives
QStringList Adjectives
Definition: entryedict.cpp:478
QList::count
int count(const T &value) const
Entry::getExtendedInfoItem
QString getExtendedInfoItem(const QString &x) const
Simple accessor.
Definition: entry.cpp:150
DictFileEdict::displayFields
static QStringList * displayFields
Definition: dictfileedict.h:81
QList::append
void append(const T &value)
EdictFormatting::Expressions
QStringList Expressions
Definition: entryedict.cpp:484
EntryEdict::EntryEdict
EntryEdict(const QString &dict)
Definition: entryedict.cpp:33
EdictFormatting::Verbs
QStringList Verbs
Definition: entryedict.cpp:483
QString::isEmpty
bool isEmpty() const
EntryEdict::kanjiLinkify
virtual QString kanjiLinkify(const QString &inString) const
Makes a link out of each kanji in.
Definition: entryedict.cpp:225
EdictFormatting::createPrefixesList
QStringList createPrefixesList()
Definition: entryedict.cpp:518
Entry::Word
QString Word
The Word (usually containing kanji) that matches this entry.
Definition: entry.h:193
DictQuery::Expression
Definition: dictquery.h:314
EdictFormatting::FieldOfApplication
QSet< QString > FieldOfApplication
Definition: entryedict.cpp:474
EdictFormatting::godanVerb
QString godanVerb
Definition: entryedict.cpp:460
QSet
EntryEdict::loadEntry
virtual bool loadEntry(const QString &entryLine)
Take a QString and load it into the Entry as appropriate The format is basically: KANJI [KANA] /(gene...
Definition: entryedict.cpp:250
EdictFormatting::adjective
QString adjective
Definition: entryedict.cpp:456
QList::first
T & first()
QString
EntryEdict::getTypesList
QStringList getTypesList() const
Simple accessor.
Definition: entryedict.cpp:71
QMultiHash::insert
QHash< Key, T >::iterator insert(const Key &key, const T &value)
EdictFormatting::GodanVerbs
QStringList GodanVerbs
Definition: entryedict.cpp:481
QStringList
EntryEdict::isNoun
bool isNoun() const
Definition: entryedict.cpp:159
EntryEdict::isAdverb
bool isAdverb() const
Definition: entryedict.cpp:89
EdictFormatting::prefix
QString prefix
Definition: entryedict.cpp:464
EdictFormatting::nounSuffix
QString nounSuffix
Definition: entryedict.cpp:467
DictQuery::getMatchWordType
MatchWordType getMatchWordType() const
Get which word type is currently set on the DictQuery.
Definition: dictquery.cpp:616
EntryEdict::isVerb
bool isVerb() const
Definition: entryedict.cpp:203
EntryEdict::clone
Entry * clone() const
A clone method, this should just implement "return new EntrySubClass(*this)".
Definition: entryedict.cpp:44
EntryEdict::isFukisokuVerb
bool isFukisokuVerb() const
Definition: entryedict.cpp:120
EdictFormatting::Suffix
QStringList Suffix
Definition: entryedict.cpp:486
EdictFormatting::Adverbs
QStringList Adverbs
Definition: entryedict.cpp:479
Entry::isKanji
bool isKanji(const QChar &character) const
Handy Utility functions for matching to lists and identifying char types.
Definition: entry.cpp:193
EntryEdict::isParticle
bool isParticle() const
Definition: entryedict.cpp:172
QString::mid
QString mid(int position, int n) const
EdictFormatting::Particle
QString Particle
Definition: entryedict.cpp:487
EdictFormatting::MiscMarkings
QSet< QString > MiscMarkings
Definition: entryedict.cpp:473
EdictFormatting::noun
QString noun
Definition: entryedict.cpp:454
EntryEdict::isCommon
bool isCommon() const
Definition: entryedict.cpp:102
Entry::Meanings
QStringList Meanings
The Meanings that match this entry.
Definition: entry.h:198
EntryEdict::dumpEntry
virtual QString dumpEntry() const
Regenerate a QString like the one we got in loadEntry()
Definition: entryedict.cpp:52
QString::at
const QChar at(int position) const
DictQuery
A class to allow users of libkiten to properly setup a database query.
Definition: dictquery.h:89
QList::last
T & last()
EntryEdict::toHTML
virtual QString toHTML() const
Returns a HTML version of an Entry.
Definition: entryedict.cpp:384
kitenmacros.h
QList::removeLast
void removeLast()
QString::length
int length() const
DictQuery::Prefix
Definition: dictquery.h:312
QString::left
QString left(int n) const
EdictFormatting::ichidanVerb
QString ichidanVerb
Definition: entryedict.cpp:459
EdictFormatting::PartsOfSpeech
QSet< QString > PartsOfSpeech
Definition: entryedict.cpp:472
EdictFormatting::suffix
QString suffix
Definition: entryedict.cpp:465
EdictFormatting::Nouns
QStringList Nouns
Definition: entryedict.cpp:477
dictfileedict.h
EdictFormatting::nounPrefix
QString nounPrefix
Definition: entryedict.cpp:466
EdictFormatting::Prefix
QStringList Prefix
Definition: entryedict.cpp:485
Entry::ExtendedInfo
QHash< QString, QString > ExtendedInfo
A hash of extended information.
Definition: entry.h:207
QString::arg
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
DictQuery::Noun
Definition: dictquery.h:309
QSTRINGLISTCHECK
#define QSTRINGLISTCHECK(x)
Definition: entryedict.cpp:31
EdictFormatting::PartOfSpeechCategories
QMultiHash< QString, QString > PartOfSpeechCategories
Definition: entryedict.cpp:471
Entry::outputListDelimiter
QString outputListDelimiter
The delimiter for lists...
Definition: entry.h:216
EdictFormatting::adverb
QString adverb
Definition: entryedict.cpp:457
QMultiHash
EdictFormatting::FukisokuVerbs
QStringList FukisokuVerbs
Definition: entryedict.cpp:482
DictQuery::Suffix
Definition: dictquery.h:313
EdictFormatting::expression
QString expression
Definition: entryedict.cpp:462
EdictFormatting::particle
QString particle
Definition: entryedict.cpp:458
DictQuery::Verb
Definition: dictquery.h:308
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:16:38 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kiten/lib

Skip menu "kiten/lib"
  • 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