Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sejong25
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Tear of Sejong
sejong25
Commits
41b11841
Commit
41b11841
authored
Jun 28, 2019
by
18신대성
Committed by
16이지혜
Jun 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input에서 생기는 오류들 싸그리 수정
parent
41957eca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
11 deletions
+22
-11
Input.js
js/Input.js
+22
-11
No files found.
js/Input.js
View file @
41b11841
...
...
@@ -63,6 +63,7 @@ Input.convert = function()
}
}
//console.log(vowels);
//console.log(krInput);
this
.
convInput
=
""
;
let
vowelIdx
=
0
;
...
...
@@ -72,10 +73,20 @@ Input.convert = function()
for
(
let
i
=
0
;
i
<=
vowels
[
vowelIdx
]
-
2
;
i
++
)
this
.
convInput
+=
krInput
[
i
];
while
(
vowelIdx
<
vowels
.
length
)
{
if
(
krInput
[
vowels
[
vowelIdx
]
-
1
]
>=
'
ㅏ
'
.
charCodeAt
(
0
))
// 모음 앞에 모음이 있을때
if
(
vowels
[
vowelIdx
]
-
1
<
0
||
krInput
[
vowels
[
vowelIdx
]
-
1
].
charCodeAt
(
0
)
>=
'
ㅏ
'
.
charCodeAt
(
0
))
// 모음 앞이 비거나 모음이 있을때
{
if
(
vowelIdx
+
1
<
vowels
.
length
)
// 다음 모음이 있을때
{
this
.
convInput
+=
krInput
[
vowels
[
vowelIdx
]];
vowelIdx
++
;
for
(
let
i
=
vowels
[
vowelIdx
]
+
1
;
i
<=
vowels
[
vowelIdx
+
1
]
-
2
;
++
i
)
this
.
convInput
+=
krInput
[
i
];
++
vowelIdx
;
}
else
// 다음 모음이 없을때
{
this
.
convInput
+=
krInput
[
vowels
[
vowelIdx
]];
for
(
let
i
=
vowels
[
vowelIdx
]
+
1
;
i
<
krInput
.
length
;
i
++
)
this
.
convInput
+=
krInput
[
i
];
++
vowelIdx
;
}
}
else
// 모음 앞에 자음이 있을때
{
...
...
@@ -94,27 +105,27 @@ Input.convert = function()
last
=
combLast
;
this
.
convInput
+=
String
.
fromCharCode
(
this
.
convertToCharCode
(
first
,
middle
,
last
));
for
(
var
i
=
vowels
[
vowelIdx
]
+
3
;
i
<
krInput
.
length
;
i
++
)
this
.
convInput
+=
krInput
[
i
];
vowelIdx
++
;
++
vowelIdx
;
}
else
// 뒤의 두 자음을 합칠수 없을때
{
last
=
this
.
convertToLast
(
krInput
[
vowels
[
vowelIdx
]
+
1
]);
this
.
convInput
+=
String
.
fromCharCode
(
this
.
convertToCharCode
(
first
,
middle
,
last
));
for
(
var
i
=
vowels
[
vowelIdx
]
+
2
;
i
<
krInput
.
length
;
i
++
)
this
.
convInput
+=
krInput
[
i
];
vowelIdx
++
;
++
vowelIdx
;
}
}
else
// 다다음 자음이 없을때
{
last
=
this
.
convertToLast
(
krInput
[
vowels
[
vowelIdx
]
+
1
]);
this
.
convInput
+=
String
.
fromCharCode
(
this
.
convertToCharCode
(
first
,
middle
,
last
));
vowelIdx
++
;
++
vowelIdx
;
}
}
else
// 다음 글자가 없을때
{
this
.
convInput
+=
String
.
fromCharCode
(
this
.
convertToCharCode
(
first
,
middle
,
last
));
vowelIdx
++
;
++
vowelIdx
;
}
}
else
// 다음 모음이 있을때
...
...
@@ -122,13 +133,13 @@ Input.convert = function()
if
(
vowels
[
vowelIdx
+
1
]
-
vowels
[
vowelIdx
]
<=
2
)
// 다음 모음 사이에 자음이 0개거나 1개
{
this
.
convInput
+=
String
.
fromCharCode
(
this
.
convertToCharCode
(
first
,
middle
,
last
));
vowelIdx
++
;
++
vowelIdx
;
}
else
if
(
vowels
[
vowelIdx
+
1
]
-
vowels
[
vowelIdx
]
===
3
)
// 다음 모음 사이에 자음이 2개
{
last
=
this
.
convertToLast
(
krInput
[
vowels
[
vowelIdx
]
+
1
]);
this
.
convInput
+=
String
.
fromCharCode
(
this
.
convertToCharCode
(
first
,
middle
,
last
));
vowelIdx
++
;
++
vowelIdx
;
}
else
// 다음 모음 사이에 자음이 3개 이상
{
...
...
@@ -138,14 +149,14 @@ Input.convert = function()
last
=
combLast
;
this
.
convInput
+=
String
.
fromCharCode
(
this
.
convertToCharCode
(
first
,
middle
,
last
));
for
(
var
i
=
vowels
[
vowelIdx
]
+
3
;
i
<
vowels
[
vowelIdx
+
1
]
-
1
;
i
++
)
this
.
convInput
+=
krInput
[
i
];
vowelIdx
++
;
++
vowelIdx
;
}
else
// 뒤의 두 자음을 합칠수 없을때
{
last
=
this
.
convertToLast
(
krInput
[
vowels
[
vowelIdx
]
+
1
]);
this
.
convInput
+=
String
.
fromCharCode
(
this
.
convertToCharCode
(
first
,
middle
,
last
));
for
(
var
i
=
vowels
[
vowelIdx
]
+
2
;
i
<
vowels
[
vowelIdx
+
1
]
-
1
;
i
++
)
this
.
convInput
+=
krInput
[
i
];
vowelIdx
++
;
++
vowelIdx
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment