Skip to content

Instantly share code, notes, and snippets.

@nipotan
Created August 19, 2016 10:47
Show Gist options
  • Save nipotan/cce668bcb6afd7db002815fef69bd929 to your computer and use it in GitHub Desktop.
Save nipotan/cce668bcb6afd7db002815fef69bd929 to your computer and use it in GitHub Desktop.
for (var i = 0; i < questionArr.length; i++) {
var qa = $.grep(questionArr[i].split(/\n/), function(n){
return n !== '' && ! n.match(/^\(0\)/);
});
qa[0] = qa[0].replace(/^(.+)_(ANT|SYN)$/, function(){
return '「' + RegExp.$1 + '」の' + (RegExp.$2 === 'ANT' ? '対' : '類') + '義語は';
});
qa[1] = qa[1].replace(/^\(1\)(.+)/,'「$1」');
console.log(qa.join(''));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment