Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/builder/PropertyImporter.java |
— | — | @@ -62,6 +62,7 @@ |
63 | 63 | } |
64 | 64 | |
65 | 65 | cid = storeConcept(rcId, name, ctype); |
| 66 | + storeSuffixInfo(analyzerPage, rcId, cid, name); |
66 | 67 | } |
67 | 68 | |
68 | 69 | if (rcType == ResourceType.ARTICLE || rcType == ResourceType.SUPPLEMENT) { |
— | — | @@ -129,6 +130,8 @@ |
130 | 131 | super.configure(args); |
131 | 132 | |
132 | 133 | if (args.isSet("attach")) buildConcepts = false; |
| 134 | + |
| 135 | + setStoreProperties(true); |
133 | 136 | } |
134 | 137 | |
135 | 138 | protected boolean getPurgeData() { |
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/builder/ConceptImporter.java |
— | — | @@ -126,6 +126,19 @@ |
127 | 127 | if (propertyStore!=null && storeProperties) ((IncrementalStoreBuilder)propertyStore).deleteDataAfter(delAfter, false); //FIXME: make sure we are not off by one! |
128 | 128 | } |
129 | 129 | |
| 130 | + protected void storeSuffixInfo(WikiPage analyzerPage, int rcId, int conceptId, String conceptName) throws PersistenceException { |
| 131 | + CharSequence sfx = analyzerPage.getTitleSuffix(); |
| 132 | + if (sfx!=null) { |
| 133 | + String qualifier = analyzer.normalizeTitle(sfx).toString(); |
| 134 | + |
| 135 | + if (analyzer.useSuffixAsCategory()) |
| 136 | + storeConceptBroader(rcId, conceptId, conceptName, qualifier, ExtractionRule.BROADER_FROM_SUFFIX); |
| 137 | + |
| 138 | + if (storeProperties) |
| 139 | + storeProperty(rcId, conceptId, conceptName, "qualifier", qualifier); |
| 140 | + } |
| 141 | + } |
| 142 | + |
130 | 143 | protected void buildTermsForMissingConcepts() throws PersistenceException { |
131 | 144 | if (!analyzer.isInitialized()) { //XXX: ugly hack! |
132 | 145 | analyzer.initialize(Namespace.canonicalNamespaces, true); |
— | — | @@ -140,10 +153,7 @@ |
141 | 154 | WikiPage analyzerPage = analyzer.makePage(0, r.getName(), "", false); //XXX: bypass analyzer page? |
142 | 155 | storePageTerms(-1, r.getId(), analyzerPage); //FIXME: skip sections, foo#bar is not a good term! |
143 | 156 | |
144 | | - if (analyzer.useSuffixAsCategory()) { |
145 | | - CharSequence sfx = analyzerPage.getTitleSuffix(); |
146 | | - if (sfx!=null) storeConceptBroader(-1, r.getId(), r.getName(), analyzer.normalizeTitle(sfx).toString(), ExtractionRule.BROADER_FROM_SUFFIX); |
147 | | - } |
| 157 | + ConceptImporter.this.storeSuffixInfo(analyzerPage, -1, r.getId(), r.getName()); |
148 | 158 | |
149 | 159 | //NOTE: covered by DatabaseLocalConceptStoreBuilder.buildSectionBroader |
150 | 160 | //CharSequence pfx = analyzerPage.getTitlePrefix(); |
— | — | @@ -285,10 +295,7 @@ |
286 | 296 | |
287 | 297 | //XXX: store interwiki-set inline for clustering ? |
288 | 298 | |
289 | | - if (analyzer.useSuffixAsCategory()) { |
290 | | - CharSequence sfx = analyzerPage.getTitleSuffix(); |
291 | | - if (sfx!=null) storeConceptBroader(rcId, conceptId, name, analyzer.normalizeTitle(sfx).toString(), ExtractionRule.BROADER_FROM_SUFFIX); |
292 | | - } |
| 299 | + storeSuffixInfo(analyzerPage, rcId, conceptId, name); |
293 | 300 | |
294 | 301 | //NOTE: can't really happen here (only applicable for sections) |
295 | 302 | //CharSequence pfx = analyzerPage.getTitlePrefix(); |
— | — | @@ -567,5 +574,37 @@ |
568 | 575 | storeConceptAlias(rcId, -1, supp.toString(), cid, name, AliasScope.SUPPLEMENT); |
569 | 576 | } |
570 | 577 | } |
| 578 | + |
| 579 | + public boolean isStoreDefinitions() { |
| 580 | + return storeDefinitions; |
| 581 | + } |
| 582 | + |
| 583 | + public void setStoreDefinitions(boolean storeDefinitions) { |
| 584 | + this.storeDefinitions = storeDefinitions; |
| 585 | + } |
| 586 | + |
| 587 | + public boolean isStoreFlatText() { |
| 588 | + return storeFlatText; |
| 589 | + } |
| 590 | + |
| 591 | + public void setStoreFlatText(boolean storeFlatText) { |
| 592 | + this.storeFlatText = storeFlatText; |
| 593 | + } |
| 594 | + |
| 595 | + public boolean isStoreProperties() { |
| 596 | + return storeProperties; |
| 597 | + } |
| 598 | + |
| 599 | + public void setStoreProperties(boolean storeProperties) { |
| 600 | + this.storeProperties = storeProperties; |
| 601 | + } |
| 602 | + |
| 603 | + public boolean isStoreRawText() { |
| 604 | + return storeRawText; |
| 605 | + } |
| 606 | + |
| 607 | + public void setStoreRawText(boolean storeRawText) { |
| 608 | + this.storeRawText = storeRawText; |
| 609 | + } |
571 | 610 | |
572 | 611 | } |