From 39c17546a91c12549e4dbac63fce9644226785f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Fri, 17 May 2019 08:33:29 +0900 Subject: [PATCH] Fix: u+i verb bug --- src/game/lib/util/string_util.js | 1 + src/game/typing/test/game.js | 26 ++++++++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/game/lib/util/string_util.js b/src/game/lib/util/string_util.js index 47dd548..09d1852 100644 --- a/src/game/lib/util/string_util.js +++ b/src/game/lib/util/string_util.js @@ -140,6 +140,7 @@ StringUtil.getMultiAlphabetFromJungsung = function(alphabet) { multiJungsungList['ㅚ'] = ['ㅗ', 'ㅣ']; multiJungsungList['ㅝ'] = ['ㅜ', 'ㅓ']; multiJungsungList['ㅞ'] = ['ㅜ', 'ㅔ']; + multiJungsungList['ㅟ'] = ['ㅜ', 'ㅣ']; multiJungsungList['ㅢ'] = ['ㅡ', 'ㅣ']; return multiJungsungList[alphabet]; diff --git a/src/game/typing/test/game.js b/src/game/typing/test/game.js index 111bede..03ab692 100644 --- a/src/game/typing/test/game.js +++ b/src/game/typing/test/game.js @@ -233,8 +233,9 @@ var TypingTest = { initTypingData: function() { var typingTextMan = new TypingTextManager(); - // var typingPracticeContents = [ "꿰뚫다" , "워머신", "홧김에" ]; // for debug var typingPracticeContents = this.getTypingTestContents(); + var typingPracticeContents = [ "십년이면 강산도 변한다." , "십년이면 강산도 변한다.", "십년이면 강산도 변한다." ]; // for debug + // var typingPracticeContents = [ "꿰뚫다" , "워머신", "홧김에" ]; // for debug // console.log(typingPracticeContents); typingTextMan.makeTestContents(typingPracticeContents); var wordCountForStage = TypingTest.WORD_COUNT_FOR_STAGE; @@ -446,11 +447,11 @@ var TypingTest = { }, getHighlioghtKey: function(inputContent, typingContent) { - var highlightKey = ""; - if(typingContent == undefined) return undefined; + var highlightKey = ""; + var inputIndex = inputContent.length - 1; var inputLength = inputContent.length; var typingLength = typingContent.length; // console.log("inputLength : " + inputLength + " / " + inputContent); @@ -476,24 +477,20 @@ var TypingTest = { // english typing test else if(isEnglishTypingApp()) { - console.log("===== english"); - console.log("misspelledIndex : " + misspelledIndex); - if(inputLength == typingLength) - highlightKey = "Enter"; - else if(misspelledIndex == -1) - highlightKey = typingContent[inputLength]; - else if(misspelledIndex > -1) - highlightKey = "Backspace"; - else + // console.log("===== english"); + // console.log("misspelledIndex : " + misspelledIndex); + // console.log("inputIndex : " + inputIndex); + if(misspelledIndex > inputIndex) highlightKey = typingContent[misspelledIndex]; + else + highlightKey = "Backspace"; } // korean typing test else { // console.log(misspelledIndex + " / " + typingContent[misspelledIndex]); - else if(typingContent[misspelledIndex] == " ") + if(typingContent[misspelledIndex] == " ") highlightKey = " "; else { - var inputIndex = inputContent.length - 1; var inputLetter = ""; var typingLetter = ""; var typingNextLetter = ""; @@ -630,6 +627,7 @@ var TypingTest = { // 입력할 글자에 종성이 있을 경우 else if(StringUtil.hasJongsung(typingLetter)) { var typingLetterJongsung = StringUtil.jongsung(typingLetter); + // 입력한 글자의 종성과 입력할 글자의 종성이 같은 경우 if(StringUtil.jongsung(inputLetter) == typingLetterJongsung) highlightKey = StringUtil.chosung(typingNextLetter);