下面是我的程式碼

import kuroshiro from "kuroshiro";
import KuromojiAnalyzer from "kuroshiro-analyzer-kuromoji";

const contractions = {
  "i'm": "I am",
  "i'll": "I will",
  "you've": "You have",
  "he's": "He is",
  "she's": "She is",
  "it's": "It is",
  "we're": "We are",
  "they're": "They are",
  "you're": "You are",
  "i'd": "I would",
  "you'd": "You would",
  "he'd": "He would",
  "she'd": "She would",
  "we'd": "We would",
  "they'd": "They would",
  "can't": "Cannot",
  "won't": "Will not",
  "don't": "Do not",
  "doesn't": "Does not",
  "isn't": "Is not",
  "aren't": "Are not",
  "wasn't": "Was not",
  "weren't": "Were not",
  "haven't": "Have not",
  "hasn't": "Has not",
  "hadn't": "Had not",
  "couldn't": "Could not",
  "wouldn't": "Would not",
  "shouldn't": "Should not",
  "mightn't": "Might not",
  "mustn't": "Must not",
  "let's": "Let us",
  "that's": "That is",
  "who's": "Who is",
  "what's": "What is",
  "where's": "Where is",
  "when's": "When is",
  "why's": "Why is",
  "how's": "How is",
  "she'll": "She will",
  "he'll": "He will",
  "it'll": "It will",
  "we'll": "We will",
  "they'll": "They will",
  "you'll": "You will",
  "that'd": "That would",
  "who'd": "Who would",
  "what'd": "What would",
  "where'd": "Where would",
  "when'd": "When would",
  "why'd": "Why would",
  "how'd": "How would",
  "i'd've": "I would have",
  "you'd've": "You would have",
  "he'd've": "He would have",
  "she'd've": "She would have",
  "we'd've": "We would have",
  "they'd've": "They would have",
  "y'all": "You all",
  "i'ma": "I am going to",
  "i'mo": "I am going to",
  "it'd've": "It would have",
  "that's": "That has",
  "who's": "Who has",
  "what's": "What has",
  "where's": "Where has",
  "when's": "When has",
  "why's": "Why has",
  "how's": "How has",
  "she's": "She has",
  "he's": "He has",
  "it's": "It has",
  "i've": "I have",
};

function expandContractions(text, contractions) {
  text = text.replace(/’/g, "'");
  return text
    .split(" ")
    .map((word) => contractions[word.toLowerCase()] || word)
    .join(" ");
}

export default async function correctWithLCS(submit, answer, lang) {
  let originalAnswer, submitWords, answerWords;

  if (lang === "jp") {
    const kuroshiroInstance = new kuroshiro();
    await kuroshiroInstance.init(new KuromojiAnalyzer({ dictPath: "/dict" }));
    originalAnswer = Array.from(answer);
    submit = await kuroshiroInstance.convert(submit, { to: "hiragana" });
    answer = await kuroshiroInstance.convert(answer, { to: "hiragana" });
    submitWords = Array.from(
      submit.toLowerCase().replace(/[\s。、，「」！？……——・]/g, "")
    );
    answerWords = Array.from(
      answer.toLowerCase().replace(/[\s。、，「」！？……——・]/g, "")
    );
  } else {
    let expandedSubmit = expandContractions(submit, contractions);
    let expandedAnswer = expandContractions(answer, contractions);
    originalAnswer = answer.split(" ");
    submitWords = expandedSubmit
      .toLowerCase()
      .replace(/[.,\/#!?$%\^&\*;:{}=\-_`~()]/g, "")
      .split(" ");
    answerWords = expandedAnswer
      .toLowerCase()
      .replace(/[.,\/#!?$%\^&\*;:{}=\-_`~()]/g, "")
      .split(" ");
  }

  const [m, n] = [submitWords.length, answerWords.length];
  const dp = new Array(m);
  for (let i = 0; i < m; ++i) {
    dp[i] = new Array(n);
    dp[i].fill(0);
  }
  for (let i = 0; i < m; ++i) {
    for (let j = 0; j < n; ++j) {
      if (i == 0 && j == 0) {
        dp[i][j] = submitWords[0] == answerWords[0] ? 1 : 0;
      } else if (i == 0) {
        dp[0][j] = submitWords[0] == answerWords[j] ? 1 : dp[0][j - 1];
      } else if (j == 0) {
        dp[i][0] = submitWords[i] == answerWords[0] ? 1 : dp[i - 1][0];
      } else {
        dp[i][j] =
          submitWords[i] == answerWords[j]
            ? dp[i - 1][j - 1] + 1
            : Math.max(dp[i - 1][j], dp[i][j - 1]);
      }
    }
  }
  let res = answerWords.map((e, idx) => ({
    word: originalAnswer[idx],
    correct: false,
  }));
  let [i, j, tmp] = [m - 1, n - 1, undefined];
  while (dp[i][j] != 0) {
    tmp = [i, j, dp[i][j]];
    if (i == 0 && j == 0) {
      res[0].correct = true;
      break;
    } else if (i == 0) {
      --j;
    } else if (j == 0) {
      --i;
    } else {
      if (submitWords[i] == answerWords[j]) {
        --i, --j;
      } else if (dp[i - 1][j] < dp[i][j - 1]) {
        --j;
      } else {
        --i;
      }
    }
    if (tmp[2] - dp[i][j] == 1) {
      res[tmp[1]].correct = true;
    }
  }
  console.assert(
    res.reduce((acc, curr) => (curr.correct ? ++acc : acc), 0) ==
      dp[m - 1][n - 1],
    "something wrong"
  );
  const acc = ((dp[m - 1][n - 1] / answerWords.length) * 100).toFixed(2);

  return { accuracy: acc, result: res };
}

當 answer 是 The current vogue in the fashion industry presents some intriguing elements. What's your preferred sartorial style? ，submit 是 The current vogue in the fashion industry presents some intriguing elements. What is your preferred sartorial style?

但最後 result 的  The current vogue in the fashion industry presents some intriguing elements. What's your preferred sartorial style?  的 "your" 會被判斷錯誤，可以幫我調整一下程式碼嗎