AnnotationItem Morfologik::createFormAnnotation_(AnnotationItem & lexemeItem, const std::string& word, std::map<std::string, std::string> & attributes) { AnnotationItem formItem(lexemeItem, StringFrag(word)); std::map<std::string, std::string>::iterator atr; for (atr = attributes.begin(); atr != attributes.end(); ++atr) { annotationManager_->setValue(formItem, atr->first, atr->second); } return formItem; }
//*** class PathNamespace *** PathNamespace::PathNamespace(const CppReader &reader, CppObjList &objs) : ok(false), reader(reader) { //recognization? QRegExp rn("^namespace\\s+([a-zA-Z_]\\w*)\\s*$"); if(! reader.header().contains(rn)) return ; ok = true; //yes! //the NamespaceItem. QString name = rn.cap(1); QStandardItem *item = objs.indexOf(name); if( item == 0) objs.append(item = formItem(name) ); //the content of the namespace. CppObjList childrens; CppReader sr(reader.body()); childrens << sr; foreach (QStandardItem *it, childrens) { item->appendRow(it); }