chore: 项目基线(基于 WeKnora 定制版,整理文件忽略规则)
This commit is contained in:
commit
9097ee699d
5769 files changed
+1446466
No files matched your search
@@ -0,0 +1,24 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"github.com/Tencent/WeKnora/internal/searchutil"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
)
|
||||
|
||||
// A missing association is preferable to attaching evidence to an unrelated
|
||||
// first paragraph. Exact Markdown targets also avoid URL-prefix collisions.
|
||||
func imageChunkOwner(url string, chunks []types.ParsedChunk) string {
|
||||
if url == "" {
|
||||
return ""
|
||||
}
|
||||
owner := ""
|
||||
for _, c := range chunks {
|
||||
if c.ChunkID != "" && searchutil.ImageURLsInContent(c.Content)[url] {
|
||||
if owner != "" && owner != c.ChunkID {
|
||||
return ""
|
||||
}
|
||||
owner = c.ChunkID
|
||||
}
|
||||
}
|
||||
return owner
|
||||
}
|
||||
Reference in new issue
Block a user