{"id":1840,"date":"2023-01-23T06:16:33","date_gmt":"2023-01-22T21:16:33","guid":{"rendered":"https:\/\/ubun2m.com\/?p=1840"},"modified":"2023-01-23T06:17:22","modified_gmt":"2023-01-22T21:17:22","slug":"%e5%bd%a2%e6%85%8b%e7%b4%a0%e8%a7%a3%e6%9e%90%e3%81%a7%e6%8a%bd%e5%87%ba%e3%81%97%e3%81%9f%e5%8d%98%e8%aa%9e%e3%82%92%e3%83%81%e3%82%a7%e3%83%83%e3%82%af%e3%81%99%e3%82%8b%e3%82%b9%e3%82%af%e3%83%aa","status":"publish","type":"post","link":"https:\/\/ubun2m.com\/?p=1840","title":{"rendered":"\u5f62\u614b\u7d20\u89e3\u6790\u3067\u62bd\u51fa\u3057\u305f\u5358\u8a9e\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3010Javascript\u3011"},"content":{"rendered":"\n<p>\u3000\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001<a href=\"?p=1924\" title=\"\">\u5225\u306e\u8a18\u4e8b<\/a>\u3067\u7d39\u4ecb\u3057\u3066\u3044\u308b\u5f62\u614b\u7d20\u89e3\u6790\u306e\u65b9\u6cd5\u3067\u51fa\u529b\u3057\u305f\u5358\u8a9e\u30ea\u30b9\u30c8\u3092\u8aad\u307f\u8fbc\u307f\u3001\u305d\u306e\u5358\u8a9e\u3092\u77e5\u3063\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u30c1\u30a7\u30c3\u30af\u3057\u3001\u77e5\u3089\u306a\u3044\u5358\u8a9e\u3092\u30ea\u30b9\u30c8\u5316\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3059\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f7f\u3044\u65b9<\/h2>\n\n\n\n<p>\u3000\u5358\u8a9e\u30ea\u30b9\u30c8\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3001\u300c\u30d5\u30a1\u30a4\u30eb\u306e\u9078\u629e\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3001\u5358\u8a9e\u30ea\u30b9\u30c8\u306eCSV\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u3067\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001\u7b46\u8005\u304c<strong>\u300cRowling, J.K.. Harry Potter \u00e0 L\u2019\u00e9cole des Sorciers (French Edition)\u300d<\/strong>\u304b\u3089\u62bd\u51fa\u3057\u305f\u5358\u8a9e\u30ea\u30b9\u30c8\u304c\u8aad\u307f\u8fbc\u307e\u308c\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<div class=\"affiliate-box\"><div class=\"affiliate-containar\"><a href=\"https:\/\/amzn.to\/3QZpzjH\" rel=\"nofollow\"><img decoding=\"async\" style=\"border: none;\" src=\"https:\/\/m.media-amazon.com\/images\/I\/516qWQcG3FL.jpg\" target=\"_blank\"><\/a><div class=\"affiliate-content\"><a href=\"https:\/\/amzn.to\/3QZpzjH\" rel=\"nofollow\">Harry Potter \u00e0 L'\u00e9cole des Sorciers (French Edition) Kindle\u7248<\/a><ul class=\"affiliate-button\"><li><a href=\"https:\/\/amzn.to\/3QZpzjH\" rel=\"nofollow\">Amazon<\/a><\/li><\/ul><\/div><\/div><\/div>\n\n\n\n<p> <\/p>\n\n\n\n<p>\u3000\u5358\u8a9e\u30ea\u30b9\u30c8\u3092\u8aad\u307f\u8fbc\u3080\u3068\u3001\u5404\u5358\u8a9e\u306e\u8a73\u7d30\u60c5\u5831\uff08\u54c1\u8a5e\u3001\u51fa\u73fe\u56de\u6570\u306a\u3069\uff09\u304c\u8868\u793a\u3055\u308c\u3001\u300c\u77e5\u3063\u3066\u3044\u308b\u300d\u307e\u305f\u306f\u300c\u77e5\u3089\u306a\u3044\u300d\u30dc\u30bf\u30f3\u304c\u51fa\u73fe\u3059\u308b\u3002\u3069\u3061\u3089\u304b\u306e\u30dc\u30bf\u30f3\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u3067\u3001\u6b21\u306e\u5358\u8a9e\u306b\u9032\u3080\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<p>\u3000\u300c\u77e5\u3089\u306a\u3044\u300d\u3092\u9078\u629e\u3057\u305f\u5358\u8a9e\u306f\u300c\u77e5\u3089\u306a\u304b\u3063\u305f\u5358\u8a9e\u30ea\u30b9\u30c8\u300d\u306b\u8ffd\u52a0\u3055\u308c\u308b\u3002\u30c1\u30a7\u30c3\u30af\u304c\u7d42\u4e86\u3057\u305f\u3089\u3001\u300c\u77e5\u3089\u306a\u304b\u3063\u305f\u5358\u8a9e\u30ea\u30b9\u30c8\u300d\u306e\u4e0b\u306b\u3042\u308b\u300c\u30b3\u30d4\u30fc\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3053\u3068\u3067\u3001\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<p>\u3000\u307e\u305f\u3001\u8868\u793a\u3059\u308b\u5358\u8a9e\u3092\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3059\u308b\u306b\u306f\u3001\u30d5\u30a3\u30eb\u30bf\u30fc\u6b04\u306e\u300c\u54c1\u8a5e\u300d\u3084\u300c\u51fa\u73fe\u56de\u6570\u300d\u306a\u3069\u306e\u6761\u4ef6\u3092\u9078\u629e\u3057\u3001\u300c\u9069\u7528\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3053\u3068\u3067\u3001\u9078\u629e\u3057\u305f\u6761\u4ef6\u306b\u57fa\u3065\u3044\u3066\u5358\u8a9e\u30ea\u30b9\u30c8\u304c\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3055\u308c\u308b\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001\u300c\u54c1\u8a5e\u300d\u304c\u300cVERB\u300d\u306b\u8a2d\u5b9a\u3055\u308c\u3001\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u304c\u9069\u7528\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>\u3000<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<style>\n#startLine {\n  width: 40px;\ntext-align: right;\n}\n<\/style>\n<h3>\u5358\u8a9e\u30ea\u30b9\u30c8\u8aad\u307f\u8fbc\u307f<\/h3>\n<input type=\"file\" id=\"fileInput\" \/><BR>\n<h3>\u5358\u8a9e\u30c1\u30a7\u30c3\u30af<\/h3>\n<figure class=\"wp-block-image size-large is-style-default m-photo\">\n<center><input type=\"text\" id=\"startLine\" \/>\/<a id =\"lineLength\">0<\/a>\n<h1 id=\"lemma\">\u5358\u8a9e<\/h1>\n<table><tr>\n    <td>\u54c1\u8a5e<\/td>\n    <td id=\"pos\"><\/td>\n    <td>\u51fa\u73fe\u56de\u6570<\/td>\n    <td id=\"count\"><\/td>\n  <\/tr>\n<\/table>\n<\/figure><center>\n<button id=\"knowBtn\" style=\"display:none;\">\u77e5\u3063\u3066\u3044\u308b<\/button>\n<button id=\"dontKnowBtn\" style=\"display:none;\">\u77e5\u3089\u306a\u3044<\/button><\/center>\n<h3>\u30d5\u30a3\u30eb\u30bf\u30fc<\/h3>\n<form id=\"filterForm\">\n  <label>\u54c1\u8a5e:<\/label>\n  <select id=\"posFilter\">\n    <option value=\"all\">All<\/option>\n  <\/select>\n  <br>\n  <label>\u51fa\u73fe\u56de\u6570:<\/label>\n  <input type=\"number\" id=\"countFilter\" min=\"0\">\n  <br>\n  <label>\u6761\u4ef6:<\/label>\n  <input type=\"radio\" id=\"greaterThan\" name=\"comparison\" value=\"greaterThan\">\n  <label for=\"greaterThan\">\u4ee5\u4e0a<\/label>\n  <input type=\"radio\" id=\"lessThan\" name=\"comparison\" value=\"lessThan\">\n  <label for=\"lessThan\">\u4ee5\u4e0b<\/label>\n  <br>\n  <button type=\"submit\">\u9069\u7528<\/button>\n  <button type=\"button\" id=\"filterToggle\">\u30d5\u30a3\u30eb\u30bf\u30fc On\/Off<\/button>\n<\/form>\n<h3>\u77e5\u3089\u306a\u304b\u3063\u305f\u5358\u8a9e\u30ea\u30b9\u30c8<\/h3>\n<textarea id=\"output\">lemma,pos,count\n<\/textarea>\n<button id=\"copyBtn\">\u30b3\u30d4\u30fc<\/button>\n\n\n\n<script>\nvar lines;\nvar allLines;\nvar currentIndex = 1;\nvar totalLines;\nvar uniquePos = [];\nvar filterEnabled = true;\n\n$(document).ready(function() {\n  \/\/ load the default.csv file when the page first loads\n  $.get(\"https:\/\/ubun2m.com\/wp-content\/uploads\/2023\/01\/default.csv\", function(data) {\n    processData(data);\n\n    $(\"#posFilter\").val(\"VERB\");\n    var selectedPos = $(\"#posFilter\").val();\n    var filteredLines = lines.filter(function(line) {\n      return line[1] === selectedPos;\n    });\n    currentIndex = 0;\n    lines = filteredLines;\n    $(\"#lineLength\").text(lines.length); \n    showLine();\n  });\n});\n\n\nconst fileInput = document.getElementById('fileInput');\nfileInput.addEventListener('change', (e) => {\n    const file = e.target.files[0];\n    const reader = new FileReader();\n    reader.onload = function(){\n        processData(reader.result);\n    };\n    reader.readAsText(file);\n});\n\n$(\"#fileInput\").change(function(e) {\n    var file = e.target.files[0];\n    $.get(file, function(data) {\n        processData(data);\n    });\n});\n\n\nfunction processData(data) {\n    allLines = data.split(\/\\r?\\n|\\r\/);\n    lines = [];\n    uniquePos = [];\n    for (var i=0; i<allLines.length; i++) {\n        var data = allLines[i].split(',');\n        var tarr = [];\n        for (var j=0; j<data.length; j++) {\n            tarr.push(data[j]);\n        }\n        lines.push(tarr);\n    }\n\n    allLines = lines;\n    \/\/in processData function\n    $(\"#posFilter\").empty();\n    for (var i = 1; i < lines.length; i++) {\n        var pos = lines[i][1];\n    \n        if (!uniquePos.includes(pos)) {\n          uniquePos.push(pos);\n          $(\"#posFilter\").append(`<option value=\"${pos}\">${pos}<\/option>`);\n        }\n      }\n\n  \n    \/\/ show the first line of data\n    $(\"#startLine\").val(1);\n    $(\"#lineLength\").text(lines.length);        \n    \/\/ show the knowBtn and dontKnowBtn\n    $(\"#knowBtn\").show();\n    $(\"#dontKnowBtn\").show();\n    showLine()\n}\n\nfunction showLine() {\n    if (currentIndex < lines.length) {\n                    $(\"#startLine\").val(currentIndex + 1);\n                    var currentLine = lines[currentIndex];\n                    $(\"#lemma\").text(currentLine[0]);\n                    $(\"#pos\").text(currentLine[1]);\n                    $(\"#count\").text(currentLine[2]);\n    }\n}\n\n$(\"#knowBtn\").click(function() {\n    currentIndex++;\n    showLine();\n});\n\n\n$(\"#dontKnowBtn\").click(function() {\n    \/\/ add the current line of data to the \"don't know\" list in the textarea\n    var currentLine = lines[currentIndex];\n    $(\"#output\").val($(\"#output\").val() + currentLine[0] + \",\" + currentLine[1] + \",\" + currentLine[2] + \"\\n\");\n    \/\/ update the current line index\n    currentIndex++;\n    \/\/ show the next line\n    showLine();\n});\n\n$(\"#endBtn\").click(function() {\n    \/\/ stop processing data\n    \/\/ hide the knowBtn and dontKnowBtn\n    $(\"#knowBtn\").hide();\n    $(\"#dontKnowBtn\").hide();\n});\n\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n    document.getElementById(\"copyBtn\").addEventListener(\"click\", function() {\n        var copyText = document.getElementById(\"output\");\n        copyText.select();\n        document.execCommand(\"copy\");\n        alert(\"Copied the text: \" + copyText.value);\n    });\n});\n\n\n$(\"#startLine\").on(\"change\", function() {\n  var inputLine = $(this).val();\n  \/\/ inputLine\u3092\u4f7f\u7528\u3057\u3066\u3001\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\n  currentIndex = inputLine - 1; \/\/ array index starts from 0\n  showLine();\n});\n\n\n\n$(\"#filterForm\").submit(function(event) {\n  event.preventDefault();\n  var selectedPos = $(\"#posFilter\").val();\n  var count = $(\"#countFilter\").val();\n  var comparison = $(\"input[name='comparison']:checked\").val();\n  lines = allLines;\n  \/\/ filter data based on the selected pos and count criteria\n  var filteredLines = lines.filter(function(line) {\n    if (selectedPos === \"all\" || line[1] === selectedPos) {\n      var countNum = parseInt(line[2]);\n      if (comparison === \"greaterThan\") {\n        return countNum > count;\n      } else if (comparison === \"lessThan\") {\n        return countNum < count;\n      } else {\n        return true;\n      }\n    }\n    return false;\n  });\n\n  currentIndex = 0;\n  lines = filteredLines;\n  $(\"#lineLength\").text(lines.length); \n  showLine();\n});\n\n$(\"#filterToggle\").click(function() {\n  if (filterEnabled) {\n    currentIndex = 0;\n    lines = allLines;\n    $(\"#lineLength\").text(lines.length); \n    showLine();\n    filterEnabled = false;\n  } else {\n    $(\"#filterForm\").submit();\n    filterEnabled = true;\n  }\n});\n\n<\/script>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u3000<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u304a\u308f\u308a\u306b<\/h2>\n\n\n\n<p>\u3000\u4eca\u56de\u306f\u3001\u5358\u8a9e\u30ea\u30b9\u30c8\u306e\u8aad\u307f\u8fbc\u307f\u3001\u5358\u8a9e\u60c5\u5831\u306e\u8868\u793a\u3001\u77e5\u3063\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u306e\u30c1\u30a7\u30c3\u30af\u3001\u5358\u8a9e\u306e\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3001\u77e5\u3089\u306a\u304b\u3063\u305f\u5358\u8a9e\u30ea\u30b9\u30c8\u306e\u4fdd\u5b58\u307e\u3067\u5b9f\u88c5\u3057\u305f\u3002\u3053\u306e\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u5f62\u614b\u7d20\u89e3\u6790\u3067\u62bd\u51fa\u3057\u305f\u5358\u8a9e\u306e\u5b66\u7fd2\u3092\u52b9\u7387\u7684\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u3060\u308d\u3046\u3002<\/p>\n\n\n\n<div class=\"affiliate-box\"><div class=\"affiliate-containar\"><a href=\"https:\/\/amzn.to\/3Ho4X1G\" rel=\"nofollow\"><img decoding=\"async\" style=\"border: none;\" src=\"https:\/\/m.media-amazon.com\/images\/I\/51CBaBs20IL.jpg\" target=\"_blank\"><\/a><div class=\"affiliate-content\"><a href=\"https:\/\/amzn.to\/3Ho4X1G\" rel=\"nofollow\">\u30b9\u30c3\u30ad\u30ea\u308f\u304b\u308bJava\u5165\u9580 \u7b2c3\u7248 \u30b9\u30c3\u30ad\u30ea\u308f\u304b\u308b\u30b7\u30ea\u30fc\u30ba Kindle\u7248<\/a><ul class=\"affiliate-button\"><li><a href=\"https:\/\/amzn.to\/3Ho4X1G\" rel=\"nofollow\">Amazon<\/a><\/li><\/ul><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u5225\u306e\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u3066\u3044\u308b\u5f62\u614b\u7d20\u89e3\u6790\u306e\u65b9\u6cd5\u3067\u51fa\u529b\u3057\u305f\u5358\u8a9e\u30ea\u30b9\u30c8\u3092\u8aad\u307f\u8fbc\u307f\u3001\u305d\u306e\u5358\u8a9e\u3092\u77e5\u3063\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u30c1\u30a7\u30c3\u30af\u3057\u3001\u77e5\u3089\u306a\u3044\u5358\u8a9e\u3092\u30ea\u30b9\u30c8\u5316\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3059\u308b\u3002 \u4f7f\u3044\u65b9 \u3000\u5358\u8a9e\u30ea\u30b9\u30c8\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3001\u300c\u30d5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1950,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3,19],"tags":[],"class_list":["post-1840","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-3","category-19"],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/ubun2m.com\/wp-content\/uploads\/2023\/01\/IMG_1858.jpeg","_links":{"self":[{"href":"https:\/\/ubun2m.com\/index.php?rest_route=\/wp\/v2\/posts\/1840","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubun2m.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubun2m.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubun2m.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubun2m.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1840"}],"version-history":[{"count":0,"href":"https:\/\/ubun2m.com\/index.php?rest_route=\/wp\/v2\/posts\/1840\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubun2m.com\/index.php?rest_route=\/wp\/v2\/media\/1950"}],"wp:attachment":[{"href":"https:\/\/ubun2m.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubun2m.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubun2m.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}