You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dist/tag/js/tag.min.js
+48-9Lines changed: 48 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -33387,8 +33387,8 @@ var Main = function () {
33387
33387
Promise.all(promises).then(function (files) {
33388
33388
try {
33389
33389
var message = parser.parseFiles(files);
33390
+
redrawVisualization();
33390
33391
if (message) {
33391
-
redrawVisualization();
33392
33392
printMessage(message);
33393
33393
}
33394
33394
} catch (err) {
@@ -34546,7 +34546,7 @@ var BratParser = function () {
34546
34546
output.texts[tbm_i].tokenId = tokens.length - 1;
34547
34547
++tbm_i;
34548
34548
}
34549
-
} else if (text[ch] === ' ') {
34549
+
} else if (/\s/.test(text[ch])) {
34550
34550
if (token_start < ch) {
34551
34551
tokens.push({
34552
34552
word: text.slice(token_start, ch),
@@ -34715,8 +34715,8 @@ var BratParser = function () {
34715
34715
}
34716
34716
}
34717
34717
}, {
34718
-
key: 'parseAttributes',
34719
-
value: function parseAttributes(tokens, mentions) {
34718
+
key: 'parseAttribute',
34719
+
value: function parseAttribute(tokens, mentions) {
34720
34720
var id = +tokens[0].slice(1),
34721
34721
attribute = tokens[1],
34722
34722
target = tokens[2];
@@ -34758,6 +34758,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
34758
34758
34759
34759
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
34760
34760
34761
+
var re = /.*(?=\.(\S+))|.*/;
34762
+
34761
34763
var Parser = function () {
34762
34764
function Parser() {
34763
34765
_classCallCheck(this, Parser);
@@ -34781,10 +34783,11 @@ var Parser = function () {
34781
34783
34782
34784
// get format from extension
34783
34785
if (!format) {
34784
-
var extension = path.slice(path.lastIndexOf('.'));
34785
-
if (extension === '.json') {
34786
+
var extension = path.toLowerCase().match(re)[1];
34787
+
34788
+
if (extension === 'json') {
34786
34789
format = 'json';
34787
-
} else if (extension === '.ann') {
34790
+
} else {
34788
34791
format = 'brat';
34789
34792
}
34790
34793
}
@@ -34812,6 +34815,42 @@ var Parser = function () {
0 commit comments