Giter VIP home page Giter VIP logo

thaidict-json's Introduction

thaidict-json

พจนานุกรม thaidict-json มีพื้นฐานอยู่บนพจนานุกรม lexitron โดย nectec ในรูปแบบของ json ประกอบด้วย 2 ไฟล์ได้แก่

  • eng2thai.json
  • thai2eng.json

โดยที่ eng2thai.json เป็นข้อมูลสำหรับแปลศัพท์อังกฤษเป็นไทย และ thai2eng.json เป็นข้อมูลสำหรับการแปลไทยเป็นอังกฤษ มีโครงสร้างเป็น json ท่านสามารถทำการ parse หรือ decode ทั้ง 2 ไฟล์นี้เพื่อใช้กับแอปพลิเคชันของท่านได้ทันที

โดย JSON มีโครงสร้างเป็นarray ของ object แต่ละคำ

[
	Object,
	Object,
	...,
	Object
]

ซึ่งในแต่ละ Object ของคำประกอบด้วยสมาชิกต่างๆดังนี้

  • Object
    • search
    • result
    • type
    • synonym
    • antonym
    • relate
    • define
    • classifier
    • sample
    • tag

สำหรับ search,result,type จะมีในทุก Object ส่วนสมาชิกอื่นๆ อาจไม่มีก็ได้ จึงขอให้ระวังเรื่อง Null Pointer Exception ไว้ด้วย

ตัวอย่าง Object แบบเต็ม

{
        "search": "เทคโนโลยีสมัยใหม่",
        "result": "advanced technologies",
        "type": "N",
        "synonym": [
          "เทคโนโลยีทันสมัย"
        ],
        "antonym": [
          "เทคโนโลยีรุ่นเก่า"
        ],
        "sample": "คอมพิวเตอร์เป็นปัจจัยสำคัญในการพัฒนาเทคโนโลยีสมัยใหม่เกือบทุกชนิด",
        "classifier": [
          "ชนิด"
        ],
        "tag" : [
          "วิทยาศาสตร์"
        ]
}

ความหมายของสามาชิกใน Object

search

คือ สมาชิกสำหรับค้นหาคำหลัก เช่น ต้องการเปลี่ยนคำว่า "dog" จากอังกฤษเป็นไทย ให้ค้นหาสมาชิก search จาก object ที่อยู่เป็น array ในไฟล์ eng2thai.json ก็จะพบกับข้อมูลของคำว่า "dog"

result

คือ คำตอบของคำที่ค้นหา เช่น ท่านค้นหาคำว่า "dog" จากสมาชิก search จะพบกับ object ซึ่งใน object นั้นจะมีสมาชิกชื่อว่า result เก็บคำว่า "สุนัข" อยู่ ซึ่งนั่นหมายความว่า "dog" แปลว่า "สุนัข"

type

คือ ประเภทของคำศัพท์ซึ่งเก็บไว้เป็นตัวย่อ พิมพ์ด้วยตัวอักษรใหญ่ทั้งหมด ซึ่งตัวย่อทั้งหมดประกอบด้วย

  • ABBR (Abbreviation)
  • ADJ (Adjective)
  • ADV (Adverb)
  • AUX (Auxiliary verb)
  • CLAS (Classifier)
  • CONJ (Conjunction)
  • DET (Determiner)
  • IDM (Idiom)
  • INT (Interjection)
  • N (Noun)
  • PHRV (Pharse verb)
  • PREP (Preposition)
  • PRF (Prefix)
  • PRON (Pronoun)
  • SL (Slang)
  • SUF (Suffix)
  • V (verb)
  • VI (Transitive verb)
  • VT (Intransitive verb)
  • VI, VT (Intransitive and Transitive verb)

synonym

คือคำที่คล้ายกันกับคำค้นหา สมาชิกนี้เก็บข้อมูลเป็น array โดยคำที่คล้ายกันกับคำค้นหาทั้งหมดจะถูกเก็บอยู่ใน array

antonym

คือคำที่ตรงข้ามกันกับคำค้นหา สมาชิกนี้เก็บข้อมูลเป็น array โดยคำที่ตรงข้ามกันกับคำค้นหาทั้งหมดจะถูกเก็บอยู่ใน array

relate

คือคำที่คล้ายกันกับผลลัพทธ์ สมาชิกนี้เก็บข้อมูลเป็น array โดยคำที่คล้ายกันกับผลลัพทธ์ทั้งหมดจะถูกเก็บอยู่ใน array

define

คือ ความหมายของคำค้นหา มีเฉพาะไฟล์ thai2eng.json เท่านั้น

classifier

คือ ลักษณะนามของคำค้นหา มีเฉพาะไฟล์ thai2eng.json เท่านั้น

sample

คือ ตัวอย่างประโยคของคำค้นหา มีเฉพาะไฟล์ thai2eng.json เท่านั้น

tag

คือ แท็กสำหรับบอกประเภทคำ มีเฉพาะไฟล์ thai2eng.json เท่านั้น tag ต่างๆนั้นถูกเก็บอยู่ในรูปแบบ array โดย tag ทีมีทั้งสิ้นมีดังนี้

  • กฎหมาย
  • กลอน
  • กวี
  • กะเหรี่ยง
  • การเมือง
  • คณิตศาสตร์
  • จีน
  • ชวา
  • ญี่ปุ่น
  • ดาราศาสตร์
  • ตะเลง
  • ถิ่น
  • ทมิฬ
  • บาลี
  • ปาก
  • ฝรั่งเศส
  • พายัพ
  • ฟิสิกส์
  • ภูมิศาสตร์
  • มลายู
  • ราชาศัพท์
  • วิทยาศาสตร์
  • สรีระ
  • สันสกฤต
  • สำนวน
  • สแลง
  • อังกฤษ
  • อีสาน
  • อุปมา
  • ฮินดี
  • เขมร
  • เคมี
  • เปอร์เซีย
  • เหนือ
  • แพทย์
  • แสลง
  • โบราณ
  • โปรตุเกส
  • โวหาร
  • โหราศาสตร์
  • ใต้
  • ไวยากรณ์

เกี่ยวกับ

โครงการ thaidict-json นี่พัฒนาต่อยอดขึ้นมาจาก lexitron 2.0 ซึ่งต้นฉบับ lexitron 2.0 นั้นสร้างโดย Nectec และปรับปรุงข้อผิดพลาดบางประการและทำให้อยู่ในรูปแบบ json โดย ภัคพล พงษ์ทวี

thaidict-json's People

Contributors

pureexe avatar

Stargazers

Toni avatar

Watchers

Johnny Duo avatar James Cloos avatar Toni avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.