곰믹스 자막(3-10)(3-11) 자막텍스트로 ClipIndex 값 구하는 로직 추가
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const xpath = require("xpath");
|
||||
const { DOMParser } = require("xmldom");
|
||||
const { DOMParser } = require("xmldom");
|
||||
const stringSimilarity = require("string-similarity");
|
||||
|
||||
/**
|
||||
@@ -18,7 +18,7 @@ function findSimilarString(xmlDoc, targetString, threshold = 0.8) {
|
||||
});
|
||||
return stringList;
|
||||
}
|
||||
|
||||
|
||||
// XML에서 모든 텍스트 추출
|
||||
const stringList = getTextNodes(xmlDoc);
|
||||
|
||||
@@ -32,13 +32,12 @@ function findSimilarString(xmlDoc, targetString, threshold = 0.8) {
|
||||
// console.log("🚀 ~ findSimilarString ~ text:", text)
|
||||
// console.log("🚀 ~ findSimilarString ~ targetString:", targetString)
|
||||
// console.log("🚀 ~ findSimilarString ~ similarity:", similarity)
|
||||
|
||||
|
||||
if (similarity > highestSimilarity && similarity >= threshold) {
|
||||
highestSimilarity = similarity;
|
||||
bestMatch = text;
|
||||
}
|
||||
});
|
||||
|
||||
return bestMatch;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user