Index: trunk/WikiWord/WikiWord/src/main/java/de/brightbyte/wikiword/ConceptType.java |
— | — | @@ -117,9 +117,21 @@ |
118 | 118 | //this.uri = WikiWord.conceptTypeURI(this.getName()); |
119 | 119 | } |
120 | 120 | |
121 | | - public static boolean isWeak(int t) { |
122 | | - return (t==UNKNOWN.code || t==OTHER.code || t==ALIAS.code); |
| 121 | + public boolean weakerThan(ConceptType t) { |
| 122 | + return weakerThan(code, t.code); |
123 | 123 | } |
| 124 | + |
| 125 | + public static boolean weakerThan(int a, int b) { |
| 126 | + if (a==UNKNOWN.code) { |
| 127 | + return b != UNKNOWN.code; |
| 128 | + } else if (a==ALIAS.code) { |
| 129 | + return b != UNKNOWN.code && b != ALIAS.code; |
| 130 | + } else if (a==OTHER.code) { |
| 131 | + return b != UNKNOWN.code && b != ALIAS.code && b != OTHER.code; |
| 132 | + } |
| 133 | + |
| 134 | + return false; |
| 135 | + } |
124 | 136 | |
125 | 137 | public String getName() { |
126 | 138 | return name; |
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseGlobalConceptStoreBuilder.java |
— | — | @@ -592,8 +592,8 @@ |
593 | 593 | |
594 | 594 | int type; |
595 | 595 | if (leftType==rightType) type = rightType; |
596 | | - else if (ConceptType.isWeak(leftType)) type = rightType; |
597 | | - else if (ConceptType.isWeak(rightType)) type = leftType; |
| 596 | + else if (ConceptType.weakerThan(leftType, rightType)) type = rightType; |
| 597 | + else if (ConceptType.weakerThan(rightType, leftType)) type = leftType; |
598 | 598 | else { |
599 | 599 | storeWarning(-1, "conflicting concept types during merge", |
600 | 600 | "concept "+leftName+" has type "+getConceptType(leftType)+", " |