본문 바로가기
카테고리 없음

MDict용 사전 만들기 강좌 2/5 사전 관련 강좌

 MDict용 사전 만들기 강좌 2/5  사전 관련 강좌

 

     MDict용 사전 만들기 강좌 2/5  사전 관련 강좌  
           

      목차
      0. MDict 사전을 왜 쓰는가?.
      1. Mdict용 사전 빌더의 설명서 보기. < - 보고 계시는 글입니다
      2. Mdict용 사전 데이터의 형식
      3. Mdict용 사전 데이터 클리핑 하기 - 백과사전을 클리핑 하자.
      4. 실제로 MDict용 데이터로 만들어 보기.
      ----------------------------------------------------
      글 : http://freedic.wo.to 의 千年魔王 

      PS : 글의 내용을 수정하지 않는 선에서 
      다른 곳으로 복사, 배포 가능합니다.
      ----------------------------------------------------
      -들어가며 
      윗 글에서 간단하게 MDict를 왜 사용해야 하는지에 대해서 간단히 논의해봤습니다.
      이번 글은 사전 데이터 제작을 위한 준비 글로서 MDict의 사전 빌더에 포함된 설명서를 살펴보고 어떻게 활용해야 할지를 알아 
      보겠습니다.
      이 글은 MDict용 사전 빌더의 설명서를 살펴보는 것으로 실제 데이터를 사전용으로 컴파일하는 것은 '4. 실제로 MDict용 
      데이터로 만들어 보기' 강좌에서 할 예정입니다. 
      간단히 MDict용 사전 데이터의 형식을 살펴보는 것이므로 슬쩍 흝어 보시기 바랍니다.
       
      -준비물
      Mdict용 사전 빌더 [MDXBuilder 2.1 Beta2 Download(1012K)]
      위에 포함된 'manual_Eng.txt' 을 기준으로 설명합니다.
       
      Mdict용 사전 빌더의 설명서 보기.
       
      MDict용 사전 데이터를 만들 수 있는 설명서입니다.
      전체적으로 보면 SugarDict용 사전 데이터 파일의 형식, KDic용 사전 파일 형식, MDict HTML 형식, MDict 
      Compact HTML형식에 대한 설명과 Keyword를 이용한 링크, 그리고 발음기호를 위한 폰트에 대한 설명입니다.
      중요 부분은 MDict HTML format 이므로 중점적으로 보시기 바랍니다.
      우리가 필요한 부분 중  'manual_Eng.txt'의 원문을 약간씩 해석(?), 설명한 것입니다.
      -------------------------------------------------------------------------------------------------------------------
      Supported data formats: 지원하는 데이터 포맷들에 대한 설명입니다.

      1) Extended SugarDict Format: < SugarDict라는 사전 포맷을 컨버팅 하는 부분입니다. 필요無
      2) KDict decoded tab format < Palm의 KDic을 지원한다는 툴입니다.
      One Entry per line, use "tab" to separate key word and text. "\n" in the 
      text will be replaced with return.
      한 행이 표제어와 설명으로 이루어지며 표제어와 설명부가 "tab"으로 나뉘어 진다는 것입니다.
      그리고 개행문자(줄바꿈표시)는 "\n"를 이용한다는 이야기지요.
      이 옵션은 Octopus홈페이지의 KDic디코딩 툴을 이용하여 Kdic용 사전을 txt로 풀어낸 후에 이를 이용하여 MDict용으로 
      변환할 때 필요합니다.
      Example: < KDic용 사전 파일을 디코딩한후 에 이렇게 사용하라는 예입니다.
      good adj.봤\nadj.登봤\nadj.봤돤꼇돤죄
      3) MDict html format: <- 중요 : Mdict에서 사용하는 html 형태입니다. 주로 이걸 씁니다.
      at least 3 lines for per entry: <- 하나의 엔트리는 3행으로 이루어집니다.
      a) the first line is keyword<- 첫 번째 행은 keyword, 즉, 인덱스 또는 표제어입니다. 이걸로 
검색합니다.
      b) the secod line and following are text, the text here should contain the 
      keyword(for display only), you can use html tags here (but don't include 
      the <html><head><body></body></head></html>). If you need to display 
      phonetic symbols, just use the <font> tag to assign a correct font face. 
      <- 두번째 행은 실제 설명을 하는 곳입니다. html tag를 사용할 수 있습니다. (다음 Tag는 안됩니다. 
      <html><head><body></body></head></html> ). font tage는 font face, size, 
      color 등등이 다 지원됩니다. font face는 폰트의 이름으로 윈도즈의 보조 프로그램 중 '문자 표'라는 프로그램으로 확인할 수 
      있습니다.
      c) end the entry with a line: <- 마지막 라인은 엔트리의 끝을 나타내는 행입니다. </>를 사용합니다.
      </>a
      examples: <- 실제 사용하는 예입니다. 잘 봐 두시기 바랍니다.
      Whole                                      <- keyword, index, 표제어, 색인어를 
      씁니다. 이걸로 검색합니다.
      <font size=5>whole</font>   <- 여기서부터 </>(마지막행)까지는 실제 해석을 씁니다. 
      <br>                                        <- 엔터로 줄 바꿈 해도 상관없습니다. 
      <font face="Kingsoft Phonetic Plain, Tahoma">(hol,hJl; houl)</font> <- 
      font face 
      </>                                          <- entry의 끝을 나타냅니다.
       
      Notes:
      Links to other keywords: <- 사전 내용 중에 표제어로 링크를 걸때 사용합니다. 전 안 씁니다.
      <a href="entry://key#section">key</a>
      key is the keyword, section is the section name in the html page.
       
      4) MDict Compact HTML format  <- MDict용 사전 만들 때 미리 태그를 만들어두고 쓰는 방식입니다.
      This format are consist of two files, one is the same as  MDict html 
      format, another file is the style format file. <- 이 형식은 두 가지 파일이 필요합니다. 하나는 
      Mdict html형태의 파일이고 하나는 스타일 파일입니다. 유용할 듯 싶으나 귀차니즘에 그냥 위의 html 형식을 쓰므로 
지나갑니다.
      style format file:
      May contain multiple style token defintion, every definition contains 3 
      lines:
      1) token( only numbers, must >0 and <256 )
      2) the begin string ( could be empty)
      3) the end string ( could be empty )
      if the token was used in text file ( use `token` ( the symbol in the upper 
      left of keybord) in text to indicate ) will enclose the following content( 
      untill the next token)  with "begin string" and "end string. if you need 
      to display "`" in text, use "&#96;" instead. 
      the format file's encoding should be the same as the main source( if you 
      use Unicode for the main source, then you should use unicode for the style 
      format file too) -> 해봤는데 사전 데이터 파일이 유니코드라면 스타일 파일도 유니코드로 저장하라는 이야기입니다.
      Example:
      Style token format file:
      1
      <font size=5>
      </font>
      2
      <br>
      3
      <font face="Kingsoft Phonetic Plain, Tahoma">
      </font>
       
      Main source file:
      whole
      `1`whole&#96;s`2`<p>`3`(hol,hJl; houl)
      </>
      The content of final text will be:
      <font size=5>whole&#%96;s</font><br><p><font face="Kingsoft Phonetic 
      Plain, Tahoma">(hol,hJl; houl)</font>
       
      Note: -> 발음기호를 추가할 때 이렇게 하라는 이야기입니다.
      If your data contains phonetic symbols, you better use Unicode as encoding 
      ( Please reference http://www.phon.ucl.ac.uk/home/wells/ipa-unicode.htm 
      about IPA) 
      How to display phonetics?
      A: MDict support two kinds of phonetics. One using ksphonetic.ttf(21 dict 
      use this), anthoer using TrueType fonts that support International 
      phonetic alphabets(IPA), for example the "Lucida Sans Unicode" in 
      Win98/2000/XP (windows\fonts\l_10646.ttf). Please copy these two files 
      into your PDA's \windows\ or \windows\fonts\ ( You may need to soft reset 
      your PocketPC )
      -> 써봤는데 폰트가 안 이쁘고(ㅡ,.ㅡ) 게다가 설명된 두 폰트에는 필요한 IPA문자가 없어서 저는 다른 방법을 씁니다.
      -------------------------------------------------------------------------------------------------------------------
      위에서 전체적으로 빌더의 기능들을 대충 살펴봤습니다.
      하지만 우리가 실제적으로 필요한 부분은 'MDict HTML' 포맷이므로 그곳만 유심히 살펴보시기 바랍니다. 밑은 'MDict 
      Compact HTML fotmat'도 유용할 것 같지만 대용량의 사전 등에서는 오히려 소스 제작할 때 헷갈리더군요. 연구해서 쓰실 분은 
      해보시기 바랍니다.
       
  



 

댓글