mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 03:58:14 +00:00
(improvement)(Headless) Abstracted tags from dimensions and metrics. (#828)
This commit is contained in:
@@ -13,9 +13,9 @@ public enum DictWordType {
|
||||
|
||||
DIMENSION("dimension"),
|
||||
|
||||
VALUE("dv"),
|
||||
VALUE("value"),
|
||||
|
||||
DATASET("dataset"),
|
||||
DATASET("dataSet"),
|
||||
|
||||
ENTITY("entity"),
|
||||
|
||||
@@ -23,8 +23,6 @@ public enum DictWordType {
|
||||
|
||||
TAG("tag"),
|
||||
|
||||
TAG_VALUE("tv"),
|
||||
|
||||
SUFFIX("suffix");
|
||||
|
||||
public static final String NATURE_SPILT = "_";
|
||||
@@ -35,7 +33,7 @@ public enum DictWordType {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getTypeWithSpilt() {
|
||||
public String getType() {
|
||||
return NATURE_SPILT + type;
|
||||
}
|
||||
|
||||
@@ -44,7 +42,7 @@ public enum DictWordType {
|
||||
return null;
|
||||
}
|
||||
for (DictWordType dictWordType : values()) {
|
||||
if (nature.endsWith(dictWordType.getTypeWithSpilt())) {
|
||||
if (nature.endsWith(dictWordType.getType())) {
|
||||
return dictWordType;
|
||||
}
|
||||
}
|
||||
@@ -54,7 +52,7 @@ public enum DictWordType {
|
||||
return DATASET;
|
||||
}
|
||||
//dimension value
|
||||
if (natures.length >= 3 && StringUtils.isNumeric(natures[1]) && StringUtils.isNumeric(natures[2])) {
|
||||
if (natures.length == 3 && StringUtils.isNumeric(natures[1]) && StringUtils.isNumeric(natures[2])) {
|
||||
return VALUE;
|
||||
}
|
||||
return null;
|
||||
@@ -76,4 +74,5 @@ public enum DictWordType {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user