Fix some code formatting issues
Change-Id: Ic021bf63cfb05b2f5d2642f08e29b9388ecad584
diff --git a/src/index.js b/src/index.js
index 9a74226..0c3faf1 100755
--- a/src/index.js
+++ b/src/index.js
@@ -25,15 +25,15 @@
.replace(/\u200D/g, '')
// Remove variation selectors (U+FE0F, U+FE0E)
.replace(/[\uFE0E\uFE0F]/g, '');
-
+
// Extract the first emoji character using Array spread to handle multi-byte emoji
const chars = [...stripped];
return chars.length > 0 ? chars[0] : stripped;
}
const optionDefinitions = [
- { name: 'sparse', alias: 's', type: Boolean, description: 'Print only the files, lines that have POS annotations.'},
- { name: 'help', alias: 'h', type: Boolean, description: 'Print this usage guide.'},
+ { name: 'sparse', alias: 's', type: Boolean, description: 'Print only the files, lines that have POS annotations.' },
+ { name: 'help', alias: 'h', type: Boolean, description: 'Print this usage guide.' },
]
const sections = [
@@ -79,7 +79,7 @@
input: process.stdin,
output: process.stdout,
terminal: false,
-
+
});
@@ -100,24 +100,24 @@
if (line.match('^#\\s*filename')) {
global.fileheader = `${line}\n`;
return;
- } else if (line.match('^#\\s*text_id')){
+ } else if (line.match('^#\\s*text_id')) {
global.fileheader += `${line}\n`;
return;
- } else if (line.match('^#\\s*eo[ft]')){
+ } else if (line.match('^#\\s*eo[ft]')) {
process.stdout.write(`${line}\n`);
return;
- } else if (line.match('^#')){
+ } else if (line.match('^#')) {
global.header += `${line}\n`;
return;
} else if (line.trim().match('^$')) {
- if(global.header == "") {
+ if (global.header == "") {
process.stdout.write("\n");
}
global.header = '';
return
}
} else {
- if (! line.match('^\\d+')) {
+ if (!line.match('^\\d+')) {
process.stdout.write(`${line}\n`);
return;
}
@@ -131,22 +131,23 @@
process.stdout.write(`${line}\n`);
return;
}
-
+
var new_tag = null;
if (word.match(wikiEmojiRegex)) {
new_tag = 'EMOWIKI';
} else if (word.match(emojiRegex)) {
new_tag = 'EMOIMG';
- } else if(word.match(actionWordRegex)) {
+ } else if (word.match(actionWordRegex)) {
new_tag = 'AKW';
- } else if(word.match(emoticonRegex)) {
+ } else if (word.match(emoticonRegex)) {
new_tag = 'EMOASC';
- } else if(word.match(hashtagRegex)) {
- } else if(word.match(urlRegex)) {
+ } else if (word.match(hashtagRegex)) {
+ new_tag = 'HST';
+ } else if (word.match(urlRegex)) {
new_tag = 'URL';
- } else if(word.match(emailRegex)) {
+ } else if (word.match(emailRegex)) {
new_tag = 'EML';
- } else if(! columns[3].match("^(NE|PROPN)") && word.match(addressRegex)) {
+ } else if (!columns[3].match("^(NE|PROPN)") && word.match(addressRegex)) {
new_tag = 'ADR';
}
if (new_tag) {
@@ -156,7 +157,7 @@
if (new_tag === 'EMOIMG') {
const base = getBaseEmoji(word);
columns[2] = base;
-
+
// Look up emoji metadata
// Try exact match first, then base emoji
const data = emojiData[word] || emojiData[base];
@@ -172,7 +173,7 @@
header = fileheader = '';
}
process.stdout.write(columns.join('\t') + '\n');
- } else if (! global.standalone) {
+ } else if (!global.standalone) {
process.stdout.write(`${line}\n`);
}
}