Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
massive massive massive reorganization ... things are getting pretty …
…close to working, so that's cool
- Loading branch information
Kevin Murphy
committed
Aug 5, 2018
1 parent
459ac1d
commit 0262c13
Showing
159 changed files
with
5,092 additions
and
172,488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
'use strict'; | ||
|
||
const _ = require('underscore'); | ||
const utils = require('./utils'); | ||
const nx = require('notatrix'); | ||
|
||
const CollaborationInterface = require('./collaboration'); | ||
const config = require('./config'); | ||
const Corpus = require('./corpus'); | ||
const Graph = require('./graph'); | ||
const GUI = require('./gui'); | ||
const Server = require('./server'); | ||
const Socket = require('./socket'); | ||
|
||
|
||
class App { | ||
constructor() { | ||
|
||
this.nx = nx; | ||
|
||
this.initialized = false; | ||
this.server = new Server(this); | ||
this.socket = new Socket(this); | ||
this.collab = new CollaborationInterface(this); | ||
this.gui = new GUI(this); | ||
this.corpus = new Corpus(this); | ||
this.graph = new Graph(this); | ||
this.initialized = true; | ||
|
||
this.gui.refresh(); | ||
this.server.connect(); | ||
|
||
} | ||
|
||
save() { | ||
|
||
if (!this.initialized) | ||
return; | ||
|
||
// save local preference stuff | ||
this.gui.save(); | ||
this.graph.save(); | ||
|
||
// save the treebank | ||
let serial = this.corpus.serialize(); | ||
serial = JSON.stringify(serial); | ||
if (this.server.is_running) { | ||
this.server.save(serial) | ||
} else { | ||
utils.storage.save(serial); | ||
} | ||
|
||
console.log('saved'); | ||
} | ||
|
||
load(serial) { | ||
|
||
serial = JSON.parse(serial); | ||
this.corpus = new Corpus(this, serial); | ||
this.gui.refresh(); | ||
|
||
} | ||
|
||
discard() { | ||
|
||
console.log('discard'); | ||
|
||
} | ||
|
||
download() { | ||
|
||
console.log('download'); | ||
|
||
} | ||
} | ||
|
||
|
||
module.exports = App; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
const _ = require('underscore'); | ||
const utils = require('../utils'); | ||
|
||
|
||
class CollaborationInterface { | ||
constructor(app) { | ||
|
||
this.app = app; | ||
|
||
} | ||
} | ||
|
||
|
||
module.exports = CollaborationInterface; |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const _ = require('underscore'); | ||
const utils = require('../utils'); | ||
|
||
|
||
var _config = { | ||
|
||
version: '0.0.0', | ||
localStorageKey: '__ud_annotatrix_prefs', | ||
treebank_id: utils.getTreebankId(), | ||
|
||
corpus: require('../corpus/config'), | ||
graph: require('../graph/config'), | ||
gui: require('../gui/config'), | ||
|
||
}; | ||
|
||
const prefs = utils.storage.load_preferences(); | ||
|
||
module.exports = _config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'use strict'; | ||
|
||
const _ = require('underscore'); | ||
const utils = require('../utils'); | ||
|
||
var _corpus = { | ||
|
||
default_filename: 'ud-annotatrix-corpus', | ||
format_preferences: [ | ||
'CoNLL-U', | ||
'CG3', | ||
'SD', | ||
'plain text', | ||
'Brackets', | ||
], | ||
|
||
set: params => { | ||
_.each((value, key) => { | ||
if (_corpus[key] !== undefined) | ||
_corpus[key] = value; | ||
}); | ||
}, | ||
|
||
}; | ||
|
||
|
||
module.exports = _corpus; |
Oops, something went wrong.