주의
8월 31일 이전 SeperatedHangul 클래스는 현재 문서의 SeperatedHangul 클래스와 큰 차이를 가지고 있습니다. HangulSeperator가 사용하고 있는 SeperatedHangul 클래스가 어느 시기에 작성된 클래스인지 확인해야합니다.
8월 31일 이후에 작성된 코드에는 첫 줄에 관련 정보가 주석으로 작성되어있습니다.
/*
Author: Park, Jonghyeon
Last Update: 2021-08-31 05:34:00
*/
HangulSeperator 클래스는 한글 자모 분리 기능을 담당합니다. 한글 자모 분리 기능은 Seperate
메서드를 통해 사용할 수 있습니다.
HangulSeperatorDebugger
프리팹은 실 사용 예시를 위해 첨부한 것으로, 동명의 클래스 스크립트를 컴포넌트로 갖는 게임 오브젝트입니다.
이름 | 설명 |
---|---|
SeperatedHangul Seperate(string content) |
content 의 한글 자모를 분리합니다. |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HangulSeperatorDebugger : MonoBehaviour
{
[ContextMenu("DebugSeperateHangul")] void DebugSeperateHangul()
{
SeperatedHangul li = HangulSeperator.Seperate("테스트 문장 ㅎㅎ!");
foreach (char i in li.normal) { print($"{(int)i} {i}"); }
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HangulSeperatorDebugger : MonoBehaviour
{
[ContextMenu("DebugSeperateHangul")] void DebugSeperateHangul()
{
SeperatedHangul li = HangulSeperator.Seperate("테스트 문장 ㅎㅎ!");
foreach (char i in li.full) { print($"{(int)i} {i}"); }
}
}
[System.Serializable]
class SeperatedHangul
{
public SeperatedHangul(string Content) { content = Content; }
public SeperatedHangul(string Content, List<char> Full, List<char> Normal, List<char> NormalSeperated, List<int> NormalCode) { content = Content; full = Full; normal = Normal; normalSeperated = NormalSeperated; normalCode = NormalCode; }
}
이름 | 설명 |
---|---|
string content |
분리 이전의 전체 문장입니다. |
List<char> full |
분리된 한글 자모와 한글 외 다른 문자를 포함하는 char 리스트입니다. |
List<char> normal |
분리된 한글 자모만 포함하는 char 리스트입니다. |
List<char> normalSeperated |
복잡한 형태의 종성 한글 자모를 단순한 한글 자모로 분리한 char 리스트입니다. |
List<int> normalCode |
내부 규칙에 따라 normalSeperated 를 정수로 변환한 결과 리스트입니다. |
- 내부 규칙은 프로젝트 공유 드라이브
[2]한국문화기술연구소 > 2차년도 수어단어집 > 수어단어집 제작_21.08.26.xlsx
의JH(지화)
시트를 기반으로 합니다.
이름 | 설명 |
---|---|
Add(char Content) | Content를 full , normal , normalSeperated 에 모두 추가하고, 내부 규칙에 따라 변환하여 normalCode 에 내부 정수 코드를 추가합니다. |