added a search bar and loaded the xml

master
Malar Kannan 2017-06-14 18:10:42 +05:30
parent 2afd3c708c
commit f9d0395e03
6 changed files with 6165 additions and 21 deletions

5593
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -13,10 +13,13 @@
"@types/react-addons-css-transition-group": "^15.0.2",
"@types/react-dom": "^15.5.0",
"@types/react-transition-group": "^1.1.0",
"@types/xml2js": "0.0.33",
"react": "^15.5.4",
"react-addons-css-transition-group": "^15.5.2",
"react-dom": "^15.5.4",
"react-transition-group": "^1.1.3"
"react-transition-group": "^1.1.3",
"xml2js": "^0.4.17",
"xml2js-xpath": "^0.8.0"
},
"devDependencies": {
"react-scripts-ts": "2.2.0"

View File

@ -19,7 +19,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Lex Editor</title>
</head>
<body>
<noscript>

516
public/new_es.xml Normal file
View File

@ -0,0 +1,516 @@
<?xml version='1.0' encoding='UTF-8'?>
<document type="lexdata">
<lexicon>
<item guid="5010">
<entry timestamp="20160611231359" type="create" signature="Adding tiger and shine words~nadu">
<lang id="en">
<unl>00.@1</unl>
<label>I</label>
<pos>N</pos>
<image>people_symbolstix/pronouns/my.png</image>
<lexprops>
<wnsynset>pronoun</wnsynset>
<morphology>
<morph form="morphclass">M0</morph>
<morph form="PLR">we</morph>
</morphology>
<usage>I</usage>
</lexprops>
<uiprops>
<property id="cat">people</property>
<property id="subcat">common</property>
</uiprops>
<groups>
<property>PEOPLE</property>
<property>PRONOUN</property>
</groups>
<syntacticprops>
<property id="frame">YN</property>
<property>uncountable</property>
<property>people</property>
<property>common</property>
</syntacticprops>
<stats>
<property id="freq">152884.0</property>
</stats>
<relations>00000000000000000001</relations>
</lang>
</entry>
<entry timestamp="20170612130125" type="import" signature="importing from existing a2d">
<lang id="es">
<unl>00.@1</unl>
<label>yo</label>
<pos>N</pos>
<lexprops>
<wnsynset>pronoun</wnsynset>
<morphology>
<morph form="morphclass">M0</morph>
</morphology>
<usage>yo</usage>
</lexprops>
<uiprops>
<property id="cat">people</property>
<property id="subcat">common</property>
</uiprops>
<syntacticprops>
<property id="frame">YN</property>
<property>uncountable</property>
<property>people</property>
<property>vivo</property>
<property>common</property>
<property>agree</property>
</syntacticprops>
<image>people_symbolstix/pronouns/my.png</image>
<groups>
<property>PEOPLE</property>
<property>PRONOUN</property>
</groups>
<stats>
<property id="freq">152884.0</property>
</stats>
<relations>000000000000000001010</relations>
</lang>
</entry>
</item>
<item guid="1885">
<entry timestamp="20160611231359" type="create" signature="Adding tiger and shine words~nadu">
<lang id="en">
<unl>00.@2</unl>
<label>you</label>
<pos>N</pos>
<image>people_symbolstix/pronouns/your.png</image>
<lexprops>
<wnsynset>pronoun</wnsynset>
<morphology>
<morph form="morphclass">M0</morph>
</morphology>
<usage>you</usage>
</lexprops>
<uiprops>
<property id="cat">people</property>
<property id="subcat">common</property>
</uiprops>
<groups>
<property>PEOPLE</property>
<property>PRONOUN</property>
</groups>
<syntacticprops>
<property id="frame">YN</property>
<property>uncountable</property>
<property>people</property>
<property>common</property>
</syntacticprops>
<stats>
<property id="freq">106042.0</property>
</stats>
<relations>00000000000000000001</relations>
</lang>
</entry>
<entry timestamp="20170612130125" type="import" signature="importing from existing a2d">
<lang id="es">
<unl>00.@2.@formal</unl>
<label>usted</label>
<pos>N</pos>
<lexprops>
<wnsynset>pronoun</wnsynset>
<morphology>
<morph form="morphclass">M0</morph>
</morphology>
<usage>usted</usage>
</lexprops>
<uiprops>
<property id="cat">people</property>
<property id="subcat">common</property>
</uiprops>
<syntacticprops>
<property id="frame">YN</property>
<property>uncountable</property>
<property>people</property>
<property>vivo</property>
<property>common</property>
</syntacticprops>
<image>people_symbolstix/pronouns/your.png</image>
<groups>
<property>PEOPLE</property>
<property>PRONOUN</property>
</groups>
<stats>
<property id="freq">106042.0</property>
</stats>
</lang>
</entry>
</item>
<item guid="5014">
<entry timestamp="20160611231359" type="create" signature="Adding tiger and shine words~nadu">
<lang id="en">
<unl>00.@3.@neuter</unl>
<label>it</label>
<pos>N</pos>
<image>people_symbolstix/pronouns/it.png</image>
<lexprops>
<wnsynset>pronoun</wnsynset>
<morphology>
<morph form="morphclass">M0</morph>
</morphology>
<usage>it</usage>
</lexprops>
<uiprops>
<property id="cat">things</property>
<property id="subcat">common</property>
</uiprops>
<groups>
<property>THINGS</property>
<property> COMMON</property>
</groups>
<syntacticprops>
<property id="frame">YN</property>
<property>uncountable</property>
<property>things</property>
<property>common</property>
<property>nodef</property>
</syntacticprops>
<stats>
<property id="freq">99341.0</property>
</stats>
<relations>00000000000000000001</relations>
</lang>
</entry>
<entry timestamp="20170612130125" type="import" signature="importing from existing a2d">
<lang id="es">
<unl>00.@3.@neuter</unl>
<label>ello</label>
<pos>N</pos>
<lexprops>
<wnsynset>pronoun</wnsynset>
<morphology>
<morph form="morphclass">M0</morph>
</morphology>
<usage>ello</usage>
</lexprops>
<uiprops>
<property id="cat">things</property>
<property id="subcat">common</property>
</uiprops>
<syntacticprops>
<property id="frame">YN</property>
<property>uncountable</property>
<property>nodef</property>
<property>things</property>
<property>common</property>
</syntacticprops>
<image>people_symbolstix/pronouns/it.png</image>
<groups>
<property>THINGS</property>
<property> COMMON</property>
</groups>
<stats>
<property id="freq">99341.0</property>
</stats>
<relations>000000000000000001010</relations>
</lang>
</entry>
</item>
<item guid="5011">
<entry timestamp="20160611231359" type="create" signature="Adding tiger and shine words~nadu">
<lang id="en">
<unl>00.@1.@pl</unl>
<label>we</label>
<pos>N</pos>
<image>people_symbolstix/pronouns/we.png</image>
<lexprops>
<wnsynset>pronoun</wnsynset>
<morphology>
<morph form="morphclass">M0</morph>
</morphology>
<usage>we</usage>
</lexprops>
<uiprops>
<property id="cat">people</property>
<property id="subcat">common</property>
</uiprops>
<groups>
<property>PEOPLE</property>
<property>PRONOUN</property>
</groups>
<syntacticprops>
<property id="frame">YN</property>
<property>uncountable</property>
<property>people</property>
<property>common</property>
</syntacticprops>
<stats>
<property id="freq">40079.0</property>
</stats>
<relations>00000000000000000001</relations>
</lang>
</entry>
<entry timestamp="20170612130125" type="import" signature="importing from existing a2d">
<lang id="es">
<unl>00.@1.@pl</unl>
<label>nosotros</label>
<pos>N</pos>
<lexprops>
<wnsynset>pronoun</wnsynset>
<morphology>
<morph form="morphclass">M0</morph>
</morphology>
<usage>nosotros</usage>
</lexprops>
<uiprops>
<property id="cat">people</property>
<property id="subcat">common</property>
</uiprops>
<syntacticprops>
<property id="frame">YN</property>
<property>uncountable</property>
<property>people</property>
<property>vivo</property>
<property>common</property>
<property>agree</property>
</syntacticprops>
<image>people_symbolstix/pronouns/we.png</image>
<groups>
<property>PEOPLE</property>
<property>PRONOUN</property>
</groups>
<stats>
<property id="freq">40079.0</property>
</stats>
<relations>000000000000000001010</relations>
</lang>
</entry>
</item>
<item guid="2473">
<entry timestamp="20160611231359" type="create" signature="Adding tiger and shine words~nadu">
<lang id="en">
<unl>4000004722</unl>
<label>just</label>
<pos>A</pos>
<image>descriptives/just.png</image>
<lexprops>
<wnsynset>merely.r.01</wnsynset>
<morphology>
<morph form="morphclass">M0</morph>
</morphology>
<usage>just</usage>
</lexprops>
<uiprops>
<property id="cat">describe</property>
<property id="subcat">adverbs</property>
</uiprops>
<groups>
<property>DESCRIBE</property>
<property>adverbs_man</property>
</groups>
<syntacticprops>
<property id="frame">YA</property>
<property>left_adj</property>
<property>describe</property>
<property>adverbs</property>
</syntacticprops>
<stats>
<property id="freq">26583.0</property>
</stats>
<relations>00000000000000000100</relations>
</lang>
</entry>
<entry timestamp="20170612130125" type="import" signature="importing from existing a2d">
<lang id="es">
<unl>4000004722</unl>
<label>sólo</label>
<pos>A</pos>
<lexprops>
<wnsynset>merely.r.01</wnsynset>
<morphology>
<morph form="morphclass">M0</morph>
</morphology>
<usage>sólo</usage>
</lexprops>
<uiprops>
<property id="cat">describe</property>
<property id="subcat">adverbs</property>
</uiprops>
<syntacticprops>
<property id="frame">YA</property>
<property>left_adj</property>
<property>describe</property>
<property>adverbs</property>
</syntacticprops>
<image>descriptives/just.png</image>
<groups>
<property>DESCRIBE</property>
<property>adverbs_man</property>
</groups>
<stats>
<property id="freq">26583.0</property>
</stats>
<relations>000010000000000001000</relations>
</lang>
</entry>
</item>
<item guid="2412">
<entry timestamp="20160611231359" type="create" signature="Adding tiger and shine words~nadu">
<lang id="en">
<unl>2002604760</unl>
<label>is</label>
<pos>V</pos>
<image>actions/is.png</image>
<lexprops>
<wnsynset>be</wnsynset>
<morphology>
<morph form="morphclass">M0</morph>
<morph form="GER">(being)</morph>
<morph form="PAS">(be)</morph>
<morph form="3PS&amp;PRS">(is)</morph>
<morph form="PTP">(been)</morph>
</morphology>
<usage>(is)</usage>
</lexprops>
<uiprops>
<property id="cat">actions</property>
<property id="subcat">other</property>
</uiprops>
<groups>
<property>ACTIONS</property>
<property> OTHER</property>
</groups>
<syntacticprops>
<property id="frame">Y-T</property>
<property>continuous</property>
<property>J_man</property>
<property>actions</property>
<property>other</property>
</syntacticprops>
<corpus>
<sentence>
<nl lang="en">he is my father.</nl>
<unl>agt(2002604760,00.@3.@male);obj(2002604760,1010080869);pos(1010080869,00.@1)</unl>
</sentence>
<sentence>
<nl lang="en">It is fine.</nl>
<unl>agt(2002604760,00.@3.@neuter);man(2002604760,3002081114)</unl>
</sentence>
<sentence>
<nl lang="en">It is blue.</nl>
<unl>agt(2002604760,00.@3.@neuter);man(2002604760,3000370869)</unl>
</sentence>
<sentence>
<nl lang="en">The car is red.</nl>
<unl>agt(2002604760,1002958343.@def);man(2002604760,3000381097)</unl>
</sentence>
<sentence>
<nl lang="en">My name is Jim.</nl>
<unl>pos(1006333653,00.@1);agt(2002604760,1006333653);obj(2002604760,Jim.@proper)</unl>
</sentence>
</corpus>
<stats>
<property id="freq">20876.0</property>
</stats>
<relations>33002200101002200110</relations>
</lang>
</entry>
<entry timestamp="20170612130125" type="import" signature="importing from existing a2d">
<lang id="es">
<unl>2002603699</unl>
<label>hay</label>
<pos>V</pos>
<lexprops>
<wnsynset>exist.v.01</wnsynset>
<morphology>
<morph form="morphclass">M89_hay</morph>
</morphology>
<usage>hay</usage>
</lexprops>
<uiprops>
<property id="cat">actions</property>
<property id="subcat">other</property>
</uiprops>
<syntacticprops>
<property id="frame">Y-T</property>
<property>hay</property>
<property>notimp</property>
<property>actions</property>
<property>other</property>
</syntacticprops>
<image>actions/is.png</image>
<groups>
<property>ACTIONS</property>
<property> OTHER</property>
</groups>
<stats>
<property id="freq">20876.0</property>
</stats>
<relations>330002002000010001000</relations>
</lang>
</entry>
</item>
<item guid="2479">
<entry timestamp="20160611231359" type="create" signature="Adding tiger and shine words~nadu">
<lang id="en">
<unl>4000037226</unl>
<label>really</label>
<pos>A</pos>
<image>descriptives/really.png</image>
<lexprops>
<wnsynset>truly.r.01</wnsynset>
<morphology>
<morph form="morphclass">M0</morph>
</morphology>
<usage>really</usage>
</lexprops>
<uiprops>
<property id="cat">describe</property>
<property id="subcat">adverbs</property>
</uiprops>
<groups>
<property>DESCRIBE</property>
<property>adverbs_man_mod</property>
</groups>
<syntacticprops>
<property id="frame">YA</property>
<property>left_adj</property>
<property>describe</property>
<property>adverbs</property>
</syntacticprops>
<stats>
<property id="freq">16713.0</property>
</stats>
<relations>00000000000000000100</relations>
</lang>
</entry>
<entry timestamp="20170612130125" type="import" signature="importing from existing a2d">
<lang id="es">
<unl>4000037226</unl>
<label>de verdad</label>
<pos>A</pos>
<lexprops>
<wnsynset>truly.r.01</wnsynset>
<morphology>
<morph form="morphclass">M0</morph>
</morphology>
<usage>de verdad</usage>
</lexprops>
<uiprops>
<property id="cat">describe</property>
<property id="subcat">adverbs</property>
</uiprops>
<syntacticprops>
<property id="frame">YA</property>
<property>left_adj</property>
<property>describe</property>
<property>adverbs</property>
</syntacticprops>
<image>descriptives/really.png</image>
<groups>
<property>DESCRIBE</property>
<property>adverbs_man_mod</property>
</groups>
<stats>
<property id="freq">16713.0</property>
</stats>
<relations>000000000000000001000</relations>
</lang>
</entry>
</item>
</lexicon>
</document>

View File

@ -1,6 +1,7 @@
import * as React from 'react';
import { FocusStyleManager } from '@blueprintjs/core';
// import { Table, Cell, Column } from '@blueprintjs/table';
import * as XML from 'xml2js';
// import { Table } from '@blueprintjs/table';
FocusStyleManager.onlyShowFocusOnTabs();
@ -9,27 +10,58 @@ FocusStyleManager.onlyShowFocusOnTabs();
class App extends React.Component<{}, null> {
render() {
return (
<nav className="pt-navbar pt-dark-app-background-color">
<div className="pt-navbar-group pt-align-left">
<span className="pt-icon-large pt-icon-edit pt-intent-success"/>
<div className="pt-navbar-heading">Lex Editor</div>
</div>
</nav>
<div>
<nav className="pt-navbar pt-dark">
<div className="pt-navbar-group pt-align-left">
<button className="pt-button pt-minimal pt-icon-large pt-icon-edit"/>
<div className="pt-navbar-heading">Lex Editor</div>
</div>
</nav>
<LexEditor fileName="/new_es.xml"/>
</div>
);
}
}
// class LexEditor extends React.Component<{}, null> {
// render() {
// const renderCell = (rowIndex: number) => {
// return <Cell>{`$${(rowIndex * 10).toFixed(2)}`}</Cell>;
// };
// return (
// <Table numRows={10}>
// <Column name="Dollars" renderCell={renderCell}/>
// </Table>
// );
// }
// interface LexEditorProps {
// fileName: string;
// }
class LexEditor extends React.Component<any, null> {
constructor(props: any) {
super(props);
}
public handleOnChange(event: any): void {
this.setState({ searchWord : event.target.value });
}
componentDidMount() {
return fetch(this.props.fileName)
.then((response) => response.text())
.then((xmlString) => {
XML.parseString(xmlString, (err, jsObj) => {
this.setState({'lexdata': jsObj});
});
})
.catch((error) => {
console.error(error);
});
}
render() {
return (
<div className="pt-input-group">
<span className="pt-icon pt-icon-search"/>
<input
className="pt-input"
type="search"
placeholder="Search input"
dir="auto"
onChange = {e => this.handleOnChange(e)}
/>
</div>
);
}
}
export default App;

View File

@ -3,7 +3,7 @@
"outDir": "build/dist",
"module": "commonjs",
"target": "es5",
"lib": ["es6", "dom"],
"lib": ["es5", "dom"],
"sourceMap": true,
"allowJs": true,
"jsx": "react",