g0v/ppt-commitment-parser

Name: ppt-commitment-parser

Owner: g0v

Description: ????????????? CSV ????

Created: 2015-07-11 12:40:15.0

Updated: 2015-07-13 14:27:48.0

Pushed: 2015-07-17 06:37:52.0

Homepage: null

Size: 288

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ppt-commitment-parser

Build Status Coverage Status

?????????? PDF ??? CSV ???? PDF ?????????????????????????????(?)??1???(1)???? ? ?.?????????????????????

Usage
CLI
mmitment-parser <options> PDF??

???????? ppt-parser --help?

Library
rt pdftojson from 'pdftojson';
rt parser from 'ppt-commitment-parser';

ojson(PDF??).then(pdfData => {
r parsedData = parser(pdfData, parserOption);
 parsedData ???????????

Output Format
?? PDF ??

??????? 1 ?? 1 ???????????? 14 ?????????

PDF

CSV ???CLI?
6 ???????? 7 ?????? 8?9 ???? x?y ???pt??? 10 ????
?????????????????????
????","????","????????","??????","","",14,80,454,"???//??"
????","????","????????","??????","??????(??)","",14,109,556,"??????(??)???//??"
.
Array ???Library?


number: 2,
numberCH: '?',
text: '???????',
page: 14,
coord: [55, 373], // ????????????pt
items: [
  {
    number: 1,
    numberCH: '?',
    text: "????",
    page: 14,
    coord: [55, 402],
    items: [
      {
        number: 1,
        numberCH: '(?)',
        text: '????????',
        page: 14,
        coord: [62, 427],
        items: [
          {
            number: 1,
            numberCH: '1',
            text: '??????',
            page: 14,
            coord: [80, 454],
            items: [
              // text-only
              {
                text: '????????/* ?? */?????????????',
                page: 14,
                coord: [132, 480]
              },
              { // text with number
                number: 1,
                numberCH: '(1)',
                text: '??????(??)',
                page: 14,
                coord: [109, 556]
                items: [ /* ... */ ]
              }, // ...
            ]
          }
        ]
      }, //...
    ]
  }, //...
]
 // ...

Error Handling
ojson(PDF??, {onError: (errType, errPayload) => {}}) // returns a promise

onError callback ? this ???? LineMachine instance??????? LineMachine ? method ??? LineMachine ?????

errType === 'PARSE_NUM'
ayload === {
put // ????

errPayload.input ????????

errType === 'NUMBER_MISMATCH'
ayload === {
xt, // ???????
ge, // ????????
mber, // ?????????????
stSiblingSection, // ???? Section instance?????????????? undefined?

???????? 1 ??????????????????????? error?

errType === 'LEVEL_MISMATCH'
ayload === {
xt, // ???????
ge, // ????????
ord, // ??????????????????? pt?
vel, // ?????-1 ????0 ??????6 ??????
stLevel, // ??????
mberCH // ???????

errPayload.text ??????????????

?????????????????????????1?????1?????????? ??????????????????????????????1??????????? error?


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.