').attr('class', 'w3-display-container').append($('').attr('style', 'vertical-align: middle;').append(targetWord)).append($(' | ').attr('class', 'w3-right-align').attr('style', 'vertical-align: middle;').append($('').attr('type', 'number').val(Object.keys(idfTable).indexOf(targetWord) < 0 ? 0 : idfTable[targetWord]))))
}
console.log($($('#ieContainer').children('tbody').find('tr')[[wordList.indexOf(targetWord)]]).position())
$("#ieTableContainer").scrollTop($($('#ieContainer').children('tbody').find('tr')[[wordList.indexOf(targetWord)]]).position().top - 50)
}
$('#newStopWord').val('')
}
function showStopwordEditor() {
$(window).unbind('keydown')
$(window).keydown(function (event) {
if (event.keyCode == 13) {
addStopWord()
}
})
$('#sweContainer').empty()
for (word of stopwords) {
$('#sweContainer').append($('').append($('').append(word)).append($('').attr('class', 'w3-button w3-hover-red w3-transparent w3-display-right').click(function (e) {
var index = $(this).parent().index()
console.log(stopwords[index])
stopwords.splice(index, 1)
console.log(stopwords)
$('#sweContainer li').eq(index).remove()
}).append("×")))
}
$('#stopWordEditorLayer').removeClass('hidden')
}
function showIdfEditor() {
$(window).unbind('keydown')
$(window).keydown(function (event) {
if (event.keyCode == 13) {
scrollIdfList()
}
})
$('#ieContainer').empty().append(
$('').append($('')
.append($('')
.attr('style', 'position: sticky; top: 0; background: white;')
.append('單詞'))
.append($(' | ')
.attr('class', 'w3-center-align')
.attr('style', 'position: sticky; top: 0; background: white;')
.append('操作'))
.append($(' | ')
.attr('class', 'w3-right-align')
.attr('style', 'position: sticky; top: 0; background: white;')
.append('單詞頻率')
)
)
)
.append($(' | '))
for (word of Object.entries(idfTable).sort((a, b) => { return (b[1] - a[1]) }).map((a) => { return a[0] }).slice(0, 1000)) {
$('#ieContainer').find('tbody')
.append($('')
.attr('class', 'w3-display-container')
.append($('')
.attr('style', 'vertical-align: middle;')
.append(word))
.append($(' | ')
.attr('class', 'w3-right-align')
.append($(' | |