return false;
}
+ // initialize the list of predefined types
+ m_doc->wordTypes()->createOldWordTypeLists();
currentElement = domElementParent.firstChildElement(KV_TYPE_GRP);
if (!currentElement.isNull()) {
result = readType(currentElement);
if (!attribute.isNull())
{
QString oldType = attribute.value();
-
if (oldType.length() >= 2 && type.left(1) == QM_USER_TYPE)
{
// they started counting at 1
type = m_doc->wordTypes()->mainTypeFromOldFormat(oldType);
subType = m_doc->wordTypes()->subTypeFromOldFormat(oldType);
-
} // not user defined - preset types
}
bool active;
QString lang;
QString textstr;
- QString exprtype;
QString q_org;
QString q_trans;
QString query_id;
type = m_doc->wordTypes()->mainTypeFromOldFormat(oldType);
subType = m_doc->wordTypes()->subTypeFromOldFormat(oldType);
-
} // not user defined - preset types
}
}
while (!currentElement.isNull()) {
- type = exprtype; // seems like type can be in the paren element and overwritten in the children here :(
//-----------
// Attributes
mc.clear();
}
- expr.translation(i).setType(type);
- expr.translation(i).setType(subType);
+ if (!type.isEmpty()) {
+ expr.translation(i).setType(type);
+ if (!subType.isEmpty()) {
+ expr.translation(i).setSubType(subType);
+ }
+ }
if (!remark.isEmpty() )
expr.translation(i).setComment (remark);
d->m_oldMainTypeNames.insert("fig", i18n("Figuratively"));
d->m_oldSubTypeNames.clear();
- d->m_oldSubTypeNames.insert("ord", i18n("Numeral Ordinal"));
- d->m_oldSubTypeNames.insert("crd", i18n("Numeral Cardinal"));
- d->m_oldSubTypeNames.insert("def", i18n("Article Definite"));
- d->m_oldSubTypeNames.insert("ind", i18n("Article Indefinite"));
- d->m_oldSubTypeNames.insert("re", i18n("Verb Regular"));
- d->m_oldSubTypeNames.insert("ir", i18n("Verb Irregular"));
- d->m_oldSubTypeNames.insert("pos", i18n("Pronoun Possessive"));
- d->m_oldSubTypeNames.insert("per", i18n("Pronoun Personal"));
- d->m_oldSubTypeNames.insert("m", i18n("Noun Male"));
- d->m_oldSubTypeNames.insert("f", i18n("Noun Female"));
- d->m_oldSubTypeNames.insert("s", i18n("Noun Neutral"));
+ d->m_oldSubTypeNames.insert("ord", i18n("Ordinal"));
+ d->m_oldSubTypeNames.insert("crd", i18n("Cardinal"));
+ d->m_oldSubTypeNames.insert("def", i18n("Definite"));
+ d->m_oldSubTypeNames.insert("ind", i18n("Indefinite"));
+ d->m_oldSubTypeNames.insert("re", i18n("Regular"));
+ d->m_oldSubTypeNames.insert("ir", i18n("Irregular"));
+ d->m_oldSubTypeNames.insert("pos", i18n("Possessive"));
+ d->m_oldSubTypeNames.insert("per", i18n("Personal"));
+ d->m_oldSubTypeNames.insert("m", i18n("Male"));
+ d->m_oldSubTypeNames.insert("f", i18n("Female"));
+ d->m_oldSubTypeNames.insert("s", i18n("Neutral"));
}
*/
-void KEduVocWordType::createSampleData()
+void KEduVocWordType::createOldWordTypeLists()
{
- //d->m_wordTypeList.clear();
-
- // for now let's create some fantasy word types:
-
+ kDebug() << "Creating word type lists for compability with kvtml-1.";
+ // first the special types which cannot be deleted:
addType("Noun", "noun", "This holds the words of type noun. You can rename it but not delete since the article training relies on it!");
- int noun = mainTypeIndex("Noun");
addSubType("Noun", "Male", "noun male", "This holds the words of type noun male. You can rename it but not delete since the article training relies on it!");
addSubType("Noun", "Female", "noun female", "This holds the words of type noun female. You can rename it but not delete since the article training relies on it!");
addSubType("Noun", "Neutral", "noun neutral", "This holds the words of type noun neutral. You can rename it but not delete since the article training relies on it!");
-
addType("Verb", "verb", "This holds the words of type verb. You can rename it but not delete since the article training relies on it!");
addSubType("Verb", "Regular", "regular", "This holds the words of type regular verbs. You can rename it but not delete since the article training relies on it!");
addSubType("Verb", "Irregular", "irregular", "This holds the words of type irregular verbs. You can rename it but not delete since the article training relies on it!");
-
addType("Adjective", "adjective", "This holds the words of type adjective. You can rename it but not delete since the article training relies on it!");
addType("Adverb", "adverb", "This holds the words of type adverb. You can rename it but not delete since the article training relies on it!");
addType("Question");
addType("Name");
-
- addType("Rot");
- addType("Blau");
- addType("Violett");
- addType("Rosa");
- addType("Gelb");
-
+ addType("Article");
+ addSubType("Article", "Definite");
+ addSubType("Article", "Indefinite");
+
+ addType("Pronoun");
+ addSubType("Pronoun", "Possessive");
+ addSubType("Pronoun", "Personal");
+
+ addType("Phrase");
+ addType("Numeral");
+ addSubType("Numeral", "Ordinal");
+ addSubType("Numeral", "Cardinal");
+
+ addType("Conjunction");
+ addType("Preposition");
+ addType("Informal");
+ addType("Figuratively");
}