mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-13 13:07:32 +00:00
(improvement)(chat) remove domain in wordservice and the model id takes precedence over the number of model aliases (#87)
This commit is contained in:
@@ -15,7 +15,7 @@ public class WordBuilderFactory {
|
||||
static {
|
||||
wordNatures.put(DictWordType.DIMENSION, new DimensionWordBuilder());
|
||||
wordNatures.put(DictWordType.METRIC, new MetricWordBuilder());
|
||||
wordNatures.put(DictWordType.DOMAIN, new ModelWordBuilder());
|
||||
wordNatures.put(DictWordType.MODEL, new ModelWordBuilder());
|
||||
wordNatures.put(DictWordType.ENTITY, new EntityWordBuilder());
|
||||
wordNatures.put(DictWordType.VALUE, new ValueWordBuilder());
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class WordService {
|
||||
|
||||
addWordsByType(DictWordType.DIMENSION, semanticSchema.getDimensions(), words);
|
||||
addWordsByType(DictWordType.METRIC, semanticSchema.getMetrics(), words);
|
||||
addWordsByType(DictWordType.DOMAIN, semanticSchema.getModels(), words);
|
||||
addWordsByType(DictWordType.MODEL, semanticSchema.getModels(), words);
|
||||
addWordsByType(DictWordType.ENTITY, semanticSchema.getEntities(), words);
|
||||
addWordsByType(DictWordType.VALUE, semanticSchema.getDimensionValues(), words);
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.tencent.supersonic.knowledge.utils;
|
||||
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.tencent.supersonic.chat.api.pojo.SchemaElementType;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class NatureHelperTest {
|
||||
|
||||
@Test
|
||||
void convertToElementType() {
|
||||
SchemaElementType schemaElementType = NatureHelper.convertToElementType("_1");
|
||||
|
||||
Assert.equals(schemaElementType, SchemaElementType.MODEL);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user