Giter Club home page Giter Club logo

thai-segmentation-json's Introduction

Currently use intetnally for mednacea project

thai-segmentation-json

This class is to semi-automatic segment Thai sentences and create a json file from .tsv (tab-separated values) file. The output is a JSON file.

The first row of .tsv file is considered as the top column.

Usage

An input file is needed as a template of a each json object. There are 2 types of structures that this class can handle.

1. Object

o-NAME-NUMBER

meaning

  • o = object
  • NAME = Name of Object
  • NUMBER = range (e.g., 0-5)or number of column (e.g., 0,1,2,3,4,5) starting from 0

2. Single value

s-NUMBER

meaning

  • s = single
  • NUMBER = range (e.g., 0-5)or number of column (e.g., 0,1,2,3,4,5) starting from 0

Example

Suppose we have

id name price
5 ไก่ทอดบอนชอน 20
6 ไก่ทอดแสนอร่อย 25

The command o-product-1-2 or o-product-1,2 will return

{
  "product": {
    "price": "20",
    "name": "ไก่ทอด บอน ชอน"
  }
}{
  "product": {
    "price": "25",
    "name": "ไก่ทอด แสน อร่อย"
  }
}

The command s-1-2 or s-1,2 will return

{
  "price": "20",
  "name": "ไก่ทอด บอน ชอน"
}{
  "price": "25",
  "name": "ไก่ทอด แสน อร่อย"
}

The command

s-0
o-product-1,2

will return

{
  "product": {
    "price": "20",
    "name": "ไก่ทอด บอน ชอน"
  },
  "id": "5"
}{
  "product": {
    "price": "25",
    "name": "ไก่ทอด แสน อร่อย"
  },
  "id": "6"
}

License

The segmentataion algorithm (namely the class LongLexTo, LongParseTree, Trie and the Lexitron dictionary) belongs to NECTEC under the LGPL License.

thai-segmentation-json's People

Contributors

nutjane avatar

Watchers

 avatar  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.