chore: replace all cn comments to en version by volc api (#313)

This commit is contained in:
tecvan
2025-07-31 15:18:11 +08:00
committed by GitHub
parent 91d6cdb430
commit 5abc63fba6
254 changed files with 5899 additions and 5844 deletions

View File

@@ -62,7 +62,7 @@ func assertValAs(typ document.TableColumnType, val string) (*document.ColumnData
ValTime: ptr.Of(emptyTime),
}, nil
}
// 支持时间戳和时间字符串
// Supports timestamp and time string
i, err := strconv.ParseInt(val, 10, 64)
if err == nil {
t := time.Unix(i, 0)
@@ -152,7 +152,7 @@ func assertValAsForce(typ document.TableColumnType, val string, nullable bool) *
}
func assertVal(val string) document.ColumnData {
// TODO: 先不处理 image
// TODO: Do not process images first
if val == "" {
return document.ColumnData{
Type: document.TableColumnTypeUnknown,

View File

@@ -75,7 +75,7 @@ func parseByRowIterator(iter rowIterator, config *contract.Config, opts ...parse
var rowData []*document.ColumnData
for j := range row {
colSchema, found := rev[j]
if !found { // 列裁剪
if !found { // column clipping
continue
}

View File

@@ -51,7 +51,7 @@ func parseJSON(config *contract.Config) parseFn {
}
} else {
for k := range rawSlices[0] {
// init 取首个 json item 中 key 的随机顺序
// Init takes the random order of keys in the first json item
header = append(header, k)
}
}

View File

@@ -163,7 +163,7 @@ func parseByPython(config *contract.Config, storage storage.Storage, ocr ocr.OCR
}
docs = append(docs, doc)
} else {
// TODO: 这里有点问题img label 可能被较短的 chunk size 截断
// TODO: There is a problem here, the img label may be truncated by the shorter chunk size
result.Content[i+1].Content = label + result.Content[i+1].Content
}
case contentTypeTable:

View File

@@ -35,7 +35,7 @@ const imgSrcFormat = `<img src="" data-tos-key="%s">`
func createSecret(uid int64, fileType string) string {
num := 10
input := fmt.Sprintf("upload_%d_Ma*9)fhi_%d_gou_%s_rand_%d", uid, time.Now().Unix(), fileType, rand.Intn(100000))
// 做md5取前20,// mapIntToBase62 把数字映射到 Base62
// Do md5, take the first 20,//mapIntToBase62 map the number to Base62
hash := sha256.Sum256([]byte(fmt.Sprintf("%s", input)))
hashString := base64.StdEncoding.EncodeToString(hash[:])
if len(hashString) > num {

View File

@@ -27,11 +27,11 @@ package vikingdb
// resp, err := r.Rerank(context.Background(), &rerank.Request{
// Data: [][]*knowledge.RetrieveSlice{
// {
// {Slice: &entity.Slice{PlainText: "吉尼斯世界纪录网站数据显示蓝鲸是目前已知世界上最大的动物体长可达30米相当于一架波音737飞机的长度"}},
// {Slice: &entity.Slice{PlainText: "一头成年雌性弓头鲸可以长到22米长而一头雄性鲸鱼可以长到18米长"}},
// {Slice: & entity. Slice {PlainText: "According to the Guinness World Records website, the blue whale is currently the largest animal known in the world, with a body length of up to 30 meters, which is equivalent to the length of a Boeing 737 aircraft"}},
// {Slice: & entity. Slice {PlainText: "An adult female bowhead whale can grow to 22 meters long, while a male whale can grow to 18 meters long"}},
// },
// },
// Query: "世界上最大的鲸鱼是什么?",
// Query: "What is the largest whale in the world?"
// TopN: nil,
// })
// assert.NoError(t, err)
@@ -39,8 +39,8 @@ package vikingdb
// for _, item := range resp.Sorted {
// fmt.Println(item.Slice.PlainText, item.Score)
// }
// // 吉尼斯世界纪录网站数据显示蓝鲸是目前已知世界上最大的动物体长可达30米相当于一架波音737飞机的长度 0.6209664529733573
// // 一头成年雌性弓头鲸可以长到22米长而一头雄性鲸鱼可以长到18米长 0.4269785303456468
// According to the Guinness World Records website, the blue whale is the largest known animal in the world, with a body length of up to 30 meters, which is equivalent to the length of a Boeing 737 aircraft 6209664529733573
// //An adult female bowhead whale can grow up to 22 meters long, while a male whale can grow up to 18 meters 4269785303456468
//
// fmt.Println(resp.TokenUsage)
// // 95

View File

@@ -272,7 +272,7 @@ func (m *milvusManager) convertFields(fields []*searchstore.Field) ([]*mentity.F
if f.Type != searchstore.FieldTypeText {
return nil, fmt.Errorf("[convertFields] milvus only support text field indexing, field=%s, type=%d", f.Name, f.Type)
}
// indexing 时只有 content 存储原文
// Only content is stored when indexing
if f.Name == searchstore.FieldTextContent {
resp = append(resp, mentity.NewField().
WithName(f.Name).

View File

@@ -112,7 +112,7 @@ func (v *vkSearchStore) Retrieve(ctx context.Context, query string, opts ...retr
return nil, fmt.Errorf("[Retrieve] vikingdb failed to build filter, %w", err)
}
if filter != nil {
// 不支持跨 partition 召回,使用 filter 替代
// Cross-partition recall is not supported, use filter instead
searchOpts = searchOpts.SetFilter(filter)
}