00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "keduvockvtmlwriter.h"
00021
00022 #include <QtCore/QTextStream>
00023 #include <QtCore/QFile>
00024
00025 #include <KDebug>
00026
00027 #include "keduvocdocument.h"
00028 #include "keduvocgrade.h"
00029 #include "keduvoclesson.h"
00030 #include "keduvocexpression.h"
00031 #include "kvtmldefs.h"
00032 #include "keduvoccommon_p.h"
00033
00034 KEduVocKvtmlWriter::KEduVocKvtmlWriter( QFile *file )
00035 {
00036
00037 m_outputFile = file;
00038 }
00039
00040
00041 bool KEduVocKvtmlWriter::writeDoc( KEduVocDocument *doc, const QString &generator )
00042 {
00043 bool first_expr = true;
00044
00045 m_doc = doc;
00046
00047 m_domDoc = QDomDocument( "kvtml SYSTEM \"kvoctrain.dtd\"" );
00048 m_domDoc.appendChild( m_domDoc.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" ) );
00049 QDomElement domElementKvtml = m_domDoc.createElement( "kvtml" );
00050 m_domDoc.appendChild( domElementKvtml );
00051
00052 domElementKvtml.setAttribute( KV_ENCODING, ( QString ) "UTF-8" );
00053 domElementKvtml.setAttribute( KV_GENERATOR, generator );
00054 domElementKvtml.setAttribute( KV_COLS, m_doc->identifierCount() );
00055 domElementKvtml.setAttribute( KV_LINES, m_doc->entryCount() );
00056
00057 if ( !m_doc->title().isEmpty() )
00058 domElementKvtml.setAttribute( KV_TITLE, m_doc->title() );
00059
00060 if ( !m_doc->author().isEmpty() )
00061 domElementKvtml.setAttribute( KV_AUTHOR, m_doc->author() );
00062
00063 if ( !m_doc->license().isEmpty() )
00064 domElementKvtml.setAttribute( KV_LICENSE, m_doc->license() );
00065
00066 if ( !m_doc->documentComment().isEmpty() )
00067 domElementKvtml.setAttribute( KV_DOC_REM, m_doc->documentComment() );
00068
00069 if ( !writeLesson( domElementKvtml ) )
00070 return false;
00071
00072 if ( !writeArticle( domElementKvtml ) )
00073 return false;
00074
00075 QList<KEduVocPersonalPronoun> pronouns;
00076 for ( int i = 0; i < m_doc->identifierCount(); i++ )
00077 pronouns.append( m_doc->identifier(i).personalPronouns() );
00078 if ( pronouns.count() > 0 ) {
00079 if ( !writePersonalPronouns(domElementKvtml, pronouns ) )
00080 return false;
00081 }
00082
00083 if ( !writeType( domElementKvtml ) )
00084 return false;
00085
00086 if ( !writeTense( domElementKvtml ) )
00087 return false;
00088
00089 if ( !writeUsage( domElementKvtml ) )
00090 return false;
00091
00092 QString q_org, q_trans;
00093 m_doc->queryIdentifier( q_org, q_trans );
00094
00095 int entryCount = m_doc->entryCount();
00096
00097 for ( int i = 0; i < entryCount; i++ ) {
00098 KEduVocExpression *entry = m_doc->entry( i );
00099 QDomElement domElementExpression = m_domDoc.createElement( KV_EXPR );
00100
00101 if ( entry->lesson() != 0 ) {
00102 int lm = entry->lesson();
00103 if ( lm > m_doc->lessonCount() ) {
00104
00105 kError() << "index of lesson member too high: " << lm << endl;
00106 lm = 0;
00107 }
00108 domElementExpression.setAttribute( KV_LESS_MEMBER, lm );
00109 }
00110
00111
00112
00113
00114
00115 if ( !entry->isActive() )
00116 domElementExpression.setAttribute( KV_INACTIVE, 1 );
00117
00118 QDomElement domElementOriginal = m_domDoc.createElement( KV_ORG );
00119 if ( first_expr ) {
00120
00121 QString s;
00122 domElementOriginal.setAttribute( KV_SIZEHINT, m_doc->sizeHint( 0 ) );
00123
00124 s = m_doc->identifier( 0 ).name().simplified();
00125 if ( s.isEmpty() )
00126 s = "original";
00127 domElementOriginal.setAttribute( KV_LANG, s );
00128 if ( s == q_org )
00129 domElementOriginal.setAttribute( KV_QUERY, ( QString ) KV_O );
00130 else if ( s == q_trans )
00131 domElementOriginal.setAttribute( KV_QUERY, ( QString ) KV_T );
00132 }
00133
00134 if ( !entry->translation( 0 ).comment().isEmpty() )
00135 domElementOriginal.setAttribute( KV_REMARK, entry->translation( 0 ).comment() );
00136
00137 if ( !entry->translation( 0 ).synonym().isEmpty() )
00138 domElementOriginal.setAttribute( KV_SYNONYM, entry->translation( 0 ).synonym() );
00139
00140 if ( !entry->translation( 0 ).example().isEmpty() )
00141 domElementOriginal.setAttribute( KV_EXAMPLE, entry->translation( 0 ).example() );
00143
00144
00145
00146
00147 if ( !entry->translation( 0 ).paraphrase().isEmpty() )
00148 domElementOriginal.setAttribute( KV_PARAPHRASE, entry->translation( 0 ).paraphrase() );
00149
00150 if ( !entry->translation( 0 ).antonym().isEmpty() )
00151 domElementOriginal.setAttribute( KV_ANTONYM, entry->translation( 0 ).antonym() );
00152
00153 if ( !entry->translation( 0 ).pronunciation().isEmpty() )
00154 domElementOriginal.setAttribute( KV_PRONUNCE, entry->translation( 0 ).pronunciation() );
00155
00156 if ( !entry->translation( 0 ).type().isEmpty() )
00157 domElementOriginal.setAttribute( KV_EXPRTYPE, m_compability.oldType( entry->translation( 0 ).type(), entry->translation( 0 ).subType() ) );
00158
00159 if ( !writeMultipleChoice(domElementOriginal, entry->translation( 0 ).multipleChoice() ) )
00160 return false;
00161
00162 QString s;
00163 QString entype = s = entry->translation( 0 ).type();
00164 int pos = s.indexOf( QM_TYPE_DIV );
00165 if ( pos >= 0 )
00166 entype = s.left( pos );
00167 else
00168 entype = s;
00169
00170 if ( entype == QM_VERB ) {
00171
00172 if ( !writeConjugEntry(domElementOriginal, entry->translation( 0 )) ) {
00173 return false;
00174 }
00175
00176
00177 } else if ( entype == QM_ADJ && !entry->translation( 0 ).comparison().isEmpty() ) {
00178 KEduVocComparison comp = entry->translation( 0 ).comparison();
00179 if ( !writeComparison(domElementOriginal, comp ) )
00180 return false;
00181 }
00182
00183 QDomText domTextOriginal = m_domDoc.createTextNode( entry->translation( 0 ).text() );
00184 domElementOriginal.appendChild( domTextOriginal );
00185 domElementExpression.appendChild( domElementOriginal );
00186
00187 int trans = 1;
00188 while ( trans < m_doc->identifierCount() ) {
00189 QDomElement domElementTranslation = m_domDoc.createElement( KV_TRANS );
00190 if ( first_expr ) {
00191
00192 QString s;
00193 domElementTranslation.setAttribute( KV_SIZEHINT, m_doc->sizeHint( trans ) );
00194
00195 s = m_doc->identifier( trans ).name().simplified();
00196 if ( s.isEmpty() ) {
00197 s.setNum( trans );
00198 s.prepend( "translation " );
00199 }
00200 domElementTranslation.setAttribute( KV_LANG, s );
00201 if ( s == q_org )
00202 domElementTranslation.setAttribute( KV_QUERY, ( QString ) KV_O );
00203 else if ( s == q_trans )
00204 domElementTranslation.setAttribute( KV_QUERY, ( QString ) KV_T );
00205 }
00206
00207 if ( entry->translation( trans ).gradeFrom( 0 ).grade() != 0 || entry->translation( 0 ).gradeFrom( trans ).grade() != 0 )
00208 domElementTranslation.setAttribute( KV_GRADE, QString::number( entry->translation( trans ).gradeFrom( 0 ).grade() ) + ';' + QString::number( entry->translation( 0 ).gradeFrom( trans ).grade() ) );
00209
00210 if ( entry->translation( trans ).gradeFrom( 0 ).practiceCount() != 0 || entry->translation( 0 ).gradeFrom( trans ).practiceCount() != 0 )
00211 domElementTranslation.setAttribute( KV_COUNT, QString::number( entry->translation( trans ).gradeFrom( 0 ).practiceCount() ) + ';' + QString::number( entry->translation( 0 ).gradeFrom( trans ).practiceCount() ) );
00212
00213 if ( entry->translation( trans ).gradeFrom( 0 ).badCount() != 0 || entry->translation( 0 ).gradeFrom( trans ).badCount() != 0 )
00214 domElementTranslation.setAttribute( KV_BAD, QString::number( entry->translation( trans ).gradeFrom( 0 ).badCount() ) + ';' + QString::number( entry->translation( 0 ).gradeFrom( trans ).badCount() ) );
00215
00216 if ( entry->translation( trans ).gradeFrom( 0 ).practiceDate().toTime_t() != 0 || entry->translation( 0 ).gradeFrom( trans ).practiceDate().toTime_t() != 0 )
00217 domElementTranslation.setAttribute( KV_DATE, QString::number( entry->translation( trans ).gradeFrom( 0 ).practiceDate().toTime_t() ) + ';' + QString::number( entry->translation( 0 ).gradeFrom( trans ).practiceDate().toTime_t() ) );
00218
00219 if ( !entry->translation( trans ).comment().isEmpty() )
00220 domElementTranslation.setAttribute( KV_REMARK, entry->translation( trans ).comment() );
00221
00222 if ( !entry->translation( trans ).falseFriend( 0 ).isEmpty() )
00223 domElementTranslation.setAttribute( KV_FAUX_AMI_F, entry->translation( trans ).falseFriend( 0 ) );
00224
00225 if ( !entry->translation( 0 ).falseFriend( trans ).isEmpty() )
00226 domElementTranslation.setAttribute( KV_FAUX_AMI_T, entry->translation( 0 ).falseFriend( trans ) );
00227
00228 if ( !entry->translation( trans ).synonym().isEmpty() )
00229 domElementTranslation.setAttribute( KV_SYNONYM, entry->translation( trans ).synonym() );
00230
00231 if ( !entry->translation( trans ).example().isEmpty() )
00232 domElementTranslation.setAttribute( KV_EXAMPLE, entry->translation( trans ).example() );
00233
00235
00236
00237
00238
00239 if ( !entry->translation( trans ).paraphrase().isEmpty() )
00240 domElementTranslation.setAttribute( KV_PARAPHRASE, entry->translation( trans ).paraphrase() );
00241
00242 if ( !entry->translation( trans ).antonym().isEmpty() )
00243 domElementTranslation.setAttribute( KV_ANTONYM, entry->translation( trans ).antonym() );
00244
00245 if ( !entry->translation( trans ).pronunciation().isEmpty() )
00246 domElementTranslation.setAttribute( KV_PRONUNCE, entry->translation( trans ).pronunciation() );
00247
00248 if ( !entry->translation( trans ).type().isEmpty() )
00249 domElementTranslation.setAttribute( KV_EXPRTYPE, m_compability.oldType( entry->translation( trans ).type(), entry->translation( trans ).subType() ) );
00250
00251 if ( !writeMultipleChoice(domElementTranslation, entry->translation( trans ).multipleChoice() ) )
00252 return false;
00253
00254 QString s;
00255 QString entype = s = entry->translation( 0 ).type();
00256 int pos = s.indexOf( QM_TYPE_DIV );
00257 if ( pos >= 0 )
00258 entype = s.left( pos );
00259 else
00260 entype = s;
00261
00262 if ( entype == QM_VERB ) {
00263 if ( !writeConjugEntry(domElementTranslation, entry->translation( trans ) ) ) {
00264 return false;
00265 }
00266 }
00267
00268 if ( entype == QM_ADJ && !entry->translation( trans ).comparison().isEmpty() ) {
00269 KEduVocComparison comp = entry->translation( trans ).comparison();
00270 if ( !writeComparison(domElementTranslation, comp ) )
00271 return false;
00272 }
00273
00274 QDomText domTextTranslation = m_domDoc.createTextNode( entry->translation( trans ).text() );
00275 domElementTranslation.appendChild( domTextTranslation );
00276 domElementExpression.appendChild( domElementTranslation );
00277
00278 trans++;
00279 }
00280
00281 domElementKvtml.appendChild( domElementExpression );
00282
00283 first_expr = false;
00284 }
00285
00286 m_domDoc.appendChild( domElementKvtml );
00287
00288 QTextStream ts( m_outputFile );
00289 m_domDoc.save( ts, 2 );
00290
00291 return true;
00292 }
00293
00294
00295 bool KEduVocKvtmlWriter::writeLesson( QDomElement &domElementParent )
00296 {
00297 if ( m_doc->lessonCount() == 0 )
00298 return true;
00299
00300 QDomElement domElementLesson = m_domDoc.createElement( KV_LESS_GRP );
00301 domElementLesson.setAttribute( KV_SIZEHINT, m_doc->sizeHint( -1 ) );
00302
00303 for ( int i = 0; i < m_doc->lessonCount(); ++i ) {
00304 QDomElement domElementDesc = m_domDoc.createElement( KV_LESS_DESC );
00305 QDomText domTextDesc = m_domDoc.createTextNode( m_doc->lesson(i).name() );
00306
00307 domElementDesc.setAttribute( KV_LESS_NO, i );
00308 if ( m_doc->currentLesson() == i ) {
00309 domElementDesc.setAttribute( KV_LESS_CURR, 1 );
00310 }
00311 if ( m_doc->lesson(i).inPractice() ) {
00312 domElementDesc.setAttribute( KV_LESS_QUERY, 1 );
00313 }
00314 domElementDesc.appendChild( domTextDesc );
00315 domElementLesson.appendChild( domElementDesc );
00316 }
00317
00318 domElementParent.appendChild( domElementLesson );
00319 return true;
00320 }
00321
00322
00323 bool KEduVocKvtmlWriter::writeArticle( QDomElement &domElementParent )
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336 {
00337 QDomElement domElementArticle = m_domDoc.createElement( KV_ARTICLE_GRP );
00338 QString def;
00339 QString indef;
00340 QString s;
00341
00342 for ( int i = 0; i < m_doc->identifierCount(); i++ )
00343 {
00344 QDomElement domElementEntry = m_domDoc.createElement( KV_ART_ENTRY );
00345 s = m_doc->identifier(i).name().simplified();
00346 domElementEntry.setAttribute( KV_LANG, s );
00347
00348 QString articleString;
00349
00350 articleString = m_doc->identifier(i).article().article( KEduVocWordFlag::Singular | KEduVocWordFlag::Definite | KEduVocWordFlag::Feminine );
00351 if ( !articleString.isEmpty() ) {
00352 QDomElement domElementFD = m_domDoc.createElement( KV_ART_FD );
00353 QDomText domTextFD = m_domDoc.createTextNode( articleString );
00354
00355 domElementFD.appendChild( domTextFD );
00356 domElementEntry.appendChild( domElementFD );
00357 }
00358 articleString = m_doc->identifier(i).article().article( KEduVocWordFlag::Singular | KEduVocWordFlag::Indefinite | KEduVocWordFlag::Feminine );
00359 if ( !articleString.isEmpty() ) {
00360 QDomElement domElementFI = m_domDoc.createElement( KV_ART_FI );
00361 QDomText domTextFI = m_domDoc.createTextNode( articleString );
00362
00363 domElementFI.appendChild( domTextFI );
00364 domElementEntry.appendChild( domElementFI );
00365 }
00366
00367
00368
00369 articleString = m_doc->identifier(i).article().article( KEduVocWordFlag::Singular | KEduVocWordFlag::Definite | KEduVocWordFlag::Masculine );
00370 if ( !articleString.isEmpty() ) {
00371 QDomElement domElementMD = m_domDoc.createElement( KV_ART_MD );
00372 QDomText domTextMD = m_domDoc.createTextNode( articleString );
00373
00374 domElementMD.appendChild( domTextMD );
00375 domElementEntry.appendChild( domElementMD );
00376 }
00377 articleString = m_doc->identifier(i).article().article( KEduVocWordFlag::Singular | KEduVocWordFlag::Indefinite | KEduVocWordFlag::Masculine );
00378 if ( !articleString.isEmpty() ) {
00379 QDomElement domElementMI = m_domDoc.createElement( KV_ART_MI );
00380 QDomText domTextMI = m_domDoc.createTextNode( articleString );
00381
00382 domElementMI.appendChild( domTextMI );
00383 domElementEntry.appendChild( domElementMI );
00384 }
00385
00386
00387 articleString = m_doc->identifier(i).article().article( KEduVocWordFlag::Singular | KEduVocWordFlag::Definite | KEduVocWordFlag::Neutral );
00388 if ( !articleString.isEmpty() ) {
00389 QDomElement domElementND = m_domDoc.createElement( KV_ART_ND );
00390 QDomText domTextND = m_domDoc.createTextNode( articleString );
00391
00392 domElementND.appendChild( domTextND );
00393 domElementEntry.appendChild( domElementND );
00394 }
00395 articleString = m_doc->identifier(i).article().article( KEduVocWordFlag::Singular | KEduVocWordFlag::Indefinite | KEduVocWordFlag::Neutral );
00396 if ( !articleString.isEmpty() ) {
00397 QDomElement domElementNI = m_domDoc.createElement( KV_ART_NI );
00398 QDomText domTextNI = m_domDoc.createTextNode( articleString );
00399
00400 domElementNI.appendChild( domTextNI );
00401 domElementEntry.appendChild( domElementNI );
00402 }
00403
00404 domElementArticle.appendChild( domElementEntry );
00405 }
00406
00407 domElementParent.appendChild( domElementArticle );
00408 return true;
00409 }
00410
00411
00412 bool KEduVocKvtmlWriter::writeType( QDomElement &domElementParent )
00413 {
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438 return true;
00439 }
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467 bool KEduVocKvtmlWriter::writeUsage( QDomElement &domElementParent )
00468 {
00469
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494 return true;
00495 }
00496
00497
00498 bool KEduVocKvtmlWriter::writeComparison( QDomElement &domElementParent, const KEduVocTranslation* translation )
00499
00500
00501
00502
00503
00504
00505
00506 {
00507 if ( translation.comparison().isEmpty() && translation.superlative().isEmpty() ) {
00508 return true;
00509 }
00510
00511 QDomElement domElementComparison = m_domDoc.createElement( KV_COMPARISON_GRP );
00512
00513 if ( !comp.l1().isEmpty() ) {
00514 QDomElement domElementL1 = m_domDoc.createElement( KV_COMP_L1 );
00515 QDomText domTextL1 = m_domDoc.createTextNode( comp.l1() );
00516
00517 domElementL1.appendChild( domTextL1 );
00518 domElementComparison.appendChild( domElementL1 );
00519 }
00520
00521 if ( !comp.l2().isEmpty() ) {
00522 QDomElement domElementL2 = m_domDoc.createElement( KV_COMP_L2 );
00523 QDomText domTextL2 = m_domDoc.createTextNode( comp.l2() );
00524
00525 domElementL2.appendChild( domTextL2 );
00526 domElementComparison.appendChild( domElementL2 );
00527 }
00528
00529 if ( !comp.l3().isEmpty() ) {
00530 QDomElement domElementL3 = m_domDoc.createElement( KV_COMP_L3 );
00531 QDomText domTextL3 = m_domDoc.createTextNode( comp.l3() );
00532
00533 domElementL3.appendChild( domTextL3 );
00534 domElementComparison.appendChild( domElementL3 );
00535 }
00536
00537 domElementParent.appendChild( domElementComparison );
00538 return true;
00539 }
00540
00541
00542 bool KEduVocKvtmlWriter::writeMultipleChoice( QDomElement &domElementParent, const KEduVocMultipleChoice &mc )
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552 {
00553 if ( mc.isEmpty() )
00554 return true;
00555
00556 QDomElement domElementMC = m_domDoc.createElement( KV_MULTIPLECHOICE_GRP );
00557
00558 if ( !mc.choice( 1 ).isEmpty() ) {
00559 QDomElement domElementMC1 = m_domDoc.createElement( KV_MC_1 );
00560 QDomText domTextMC1 = m_domDoc.createTextNode( mc.choice( 1 ) );
00561
00562 domElementMC1.appendChild( domTextMC1 );
00563 domElementMC.appendChild( domElementMC1 );
00564 }
00565
00566 if ( !mc.choice( 2 ).isEmpty() ) {
00567 QDomElement domElementMC2 = m_domDoc.createElement( KV_MC_2 );
00568 QDomText domTextMC2 = m_domDoc.createTextNode( mc.choice( 2 ) );
00569
00570 domElementMC2.appendChild( domTextMC2 );
00571 domElementMC.appendChild( domElementMC2 );
00572 }
00573
00574 if ( !mc.choice( 3 ).isEmpty() ) {
00575 QDomElement domElementMC3 = m_domDoc.createElement( KV_MC_3 );
00576 QDomText domTextMC3 = m_domDoc.createTextNode( mc.choice( 3 ) );
00577
00578 domElementMC3.appendChild( domTextMC3 );
00579 domElementMC.appendChild( domElementMC3 );
00580 }
00581
00582 if ( !mc.choice( 4 ).isEmpty() ) {
00583 QDomElement domElementMC4 = m_domDoc.createElement( KV_MC_4 );
00584 QDomText domTextMC4 = m_domDoc.createTextNode( mc.choice( 4 ) );
00585
00586 domElementMC4.appendChild( domTextMC4 );
00587 domElementMC.appendChild( domElementMC4 );
00588 }
00589
00590 if ( !mc.choice( 5 ).isEmpty() ) {
00591 QDomElement domElementMC5 = m_domDoc.createElement( KV_MC_5 );
00592 QDomText domTextMC5 = m_domDoc.createTextNode( mc.choice( 5 ) );
00593
00594 domElementMC5.appendChild( domTextMC5 );
00595 domElementMC.appendChild( domElementMC5 );
00596 }
00597
00598 domElementParent.appendChild( domElementMC );
00599 return true;
00600 }
00601
00602
00603 bool KEduVocKvtmlWriter::writeConjugHeader( QDomElement &domElementParent, QList<KEduVocConjugation> &curr_conjug )
00604 {
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622 if ( curr_conjug.size() == 0 )
00623 return true;
00624
00625 QDomElement domElementConjug = m_domDoc.createElement( KV_CONJUG_GRP );
00626 QString s;
00627
00628 for ( int ent = 0; ent < qMin( curr_conjug.count(), m_doc->identifierCount() ); ent++ ) {
00629 QDomElement domElementEntry = m_domDoc.createElement( KV_CON_ENTRY );
00630
00631 s = m_doc->identifier( ent ).name().simplified();
00632 if ( s.isEmpty() ) {
00633 s.setNum( ent );
00634 s.prepend( "translation " );
00635 }
00636
00637 domElementEntry.setAttribute( KV_LANG, s );
00638 if ( !writeConjug(domElementEntry, curr_conjug[ent], "--" ) )
00639 return false;
00640
00641 domElementConjug.appendChild( domElementEntry );
00642 }
00643
00644 domElementParent.appendChild( domElementConjug );
00645 return true;
00646 }
00647
00648
00649 bool KEduVocKvtmlWriter::writeConjugEntry( QDomElement &domElementParent, KEduVocTranslation &translation )
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666 {
00667
00668
00669 QDomElement domElementConjug = m_domDoc.createElement( KV_CONJUG_GRP );
00670
00671 foreach ( const QString &tense, translation.conjugationTenses() ) {
00672 QDomElement domElementType = m_domDoc.createElement( KV_CON_TYPE );
00673
00674 domElementType.setAttribute( KV_CON_NAME, m_compability.oldTense(tense) );
00675
00676 if ( !writeConjug(domElementType, translation.conjugation(tense), m_compability.oldTense(tense) ) )
00677 return false;
00678
00679 domElementConjug.appendChild( domElementType );
00680 }
00681
00682 domElementParent.appendChild( domElementConjug );
00683 return true;
00684 }
00685
00686
00687 bool KEduVocKvtmlWriter::writeConjug( QDomElement &domElementParent, const KEduVocConjugation &curr_conjug, const QString &type )
00688 {
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778 kDebug() << "Implement me!";
00779 return false;
00780 }
00781
00782 bool KEduVocKvtmlWriter::writePersonalPronouns( QDomElement &domElementParent, QList<KEduVocPersonalPronoun> &curr_conjug )
00783 {
00784
00785
00786
00787
00788
00789