{"action":"created","comment":{"url":"https://api.github.com/repos/bardsoftware/papeeria/pulls/comments/74416065","id":74416065,"diff_hunk":"@@ -0,0 +1,70 @@\n+#!/bin/bash\n+\n+# usage info\n+show_help() {\n+cat << EOF\n+Usage: ${0##*/} [options...] [file]\n+Launch hunspell on file, convert output to JSON format \n+and write to standard output.\n+\n+    -h         display this help and exit\n+    -d dict    use custom dictionaries\n+\n+Example: ${0##*/} demo.tex                      # launch hunspell on 'demo.tex'\n+         ${0##*/} -d ru_RU ru_demo.tex          # use russian dictionary\n+EOF\n+}\n+\n+DICT=\n+OPTIND=1\n+\n+# command line arguments processing\n+while getopts \":hd:\" opt; do\n+    case \"$opt\" in\n+        h)\n+            show_help\n+            exit 0\n+            ;;\n+        d)\n+            DICT=\"-p $OPTARG\"\n+            ;;\n+        ?)\n+            echo -e \"Invalid option: -$OPTARG\\n\" >&2\n+            show_help >&2\n+            exit 1\n+            ;;\n+    esac\n+done\n+shift $((OPTIND-1))\n+\n+if [ \"$#\" != \"1\" ]\n+then\n+    echo -e \"Missing input file\\n\" >&2\n+    show_help >&2\n+    exit 2\n+fi\n+\n+INFILE=$1\n+\n+JSON=$(\n+    cat $INFILE    | \n+    hunspell -a -t | \n+    grep \"^&.*\"    | \n+    awk $DICT '\n+    BEGIN { print \"{\" }\n+    {\n+        print \"\\t\\\"\"$2\"\\\": [\" ;\n+\n+        split($0, split_string, \": \");\n+        options_number=split(split_string[2], options, \", \");\n+\n+        for (i = 1; i <= options_number; i++) \n+            {print \"\\t\\t\\\"\"options[i]\"\\\",\"} ","path":"backend/spellchecker/huntojson.sh","position":62,"original_position":62,"commit_id":"a197b6e1f82925c14798e018e0060fd01779370f","original_commit_id":"a197b6e1f82925c14798e018e0060fd01779370f","user":{"login":"dbarashev","id":2028330,"avatar_url":"https://avatars.githubusercontent.com/u/2028330?v=3","gravatar_id":"","url":"https://api.github.com/users/dbarashev","html_url":"https://github.com/dbarashev","followers_url":"https://api.github.com/users/dbarashev/followers","following_url":"https://api.github.com/users/dbarashev/following{/other_user}","gists_url":"https://api.github.com/users/dbarashev/gists{/gist_id}","starred_url":"https://api.github.com/users/dbarashev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbarashev/subscriptions","organizations_url":"https://api.github.com/users/dbarashev/orgs","repos_url":"https://api.github.com/users/dbarashev/repos","events_url":"https://api.github.com/users/dbarashev/events{/privacy}","received_events_url":"https://api.github.com/users/dbarashev/received_events","type":"User","site_admin":false},"body":"Comma after the last element of the array produces invalid JSON, at least from `jq` perspective.","created_at":"2016-08-11T12:54:20Z","updated_at":"2016-08-11T12:54:20Z","html_url":"https://github.com/bardsoftware/papeeria/pull/9#discussion_r74416065","pull_request_url":"https://api.github.com/repos/bardsoftware/papeeria/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/bardsoftware/papeeria/pulls/comments/74416065"},"html":{"href":"https://github.com/bardsoftware/papeeria/pull/9#discussion_r74416065"},"pull_request":{"href":"https://api.github.com/repos/bardsoftware/papeeria/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/bardsoftware/papeeria/pulls/9","id":80835034,"html_url":"https://github.com/bardsoftware/papeeria/pull/9","diff_url":"https://github.com/bardsoftware/papeeria/pull/9.diff","patch_url":"https://github.com/bardsoftware/papeeria/pull/9.patch","issue_url":"https://api.github.com/repos/bardsoftware/papeeria/issues/9","number":9,"state":"open","locked":false,"title":"Issue #8, convert hunspell output to spellchecker JSON format","user":{"login":"teners","id":4928316,"avatar_url":"https://avatars.githubusercontent.com/u/4928316?v=3","gravatar_id":"","url":"https://api.github.com/users/teners","html_url":"https://github.com/teners","followers_url":"https://api.github.com/users/teners/followers","following_url":"https://api.github.com/users/teners/following{/other_user}","gists_url":"https://api.github.com/users/teners/gists{/gist_id}","starred_url":"https://api.github.com/users/teners/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teners/subscriptions","organizations_url":"https://api.github.com/users/teners/orgs","repos_url":"https://api.github.com/users/teners/repos","events_url":"https://api.github.com/users/teners/events{/privacy}","received_events_url":"https://api.github.com/users/teners/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-10T17:32:54Z","updated_at":"2016-08-11T12:54:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"70e505a021f10ee50430910cb53fdedbb9e5324c","assignee":{"login":"teners","id":4928316,"avatar_url":"https://avatars.githubusercontent.com/u/4928316?v=3","gravatar_id":"","url":"https://api.github.com/users/teners","html_url":"https://github.com/teners","followers_url":"https://api.github.com/users/teners/followers","following_url":"https://api.github.com/users/teners/following{/other_user}","gists_url":"https://api.github.com/users/teners/gists{/gist_id}","starred_url":"https://api.github.com/users/teners/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teners/subscriptions","organizations_url":"https://api.github.com/users/teners/orgs","repos_url":"https://api.github.com/users/teners/repos","events_url":"https://api.github.com/users/teners/events{/privacy}","received_events_url":"https://api.github.com/users/teners/received_events","type":"User","site_admin":false},"assignees":[{"login":"teners","id":4928316,"avatar_url":"https://avatars.githubusercontent.com/u/4928316?v=3","gravatar_id":"","url":"https://api.github.com/users/teners","html_url":"https://github.com/teners","followers_url":"https://api.github.com/users/teners/followers","following_url":"https://api.github.com/users/teners/following{/other_user}","gists_url":"https://api.github.com/users/teners/gists{/gist_id}","starred_url":"https://api.github.com/users/teners/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teners/subscriptions","organizations_url":"https://api.github.com/users/teners/orgs","repos_url":"https://api.github.com/users/teners/repos","events_url":"https://api.github.com/users/teners/events{/privacy}","received_events_url":"https://api.github.com/users/teners/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/bardsoftware/papeeria/pulls/9/commits","review_comments_url":"https://api.github.com/repos/bardsoftware/papeeria/pulls/9/comments","review_comment_url":"https://api.github.com/repos/bardsoftware/papeeria/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bardsoftware/papeeria/issues/9/comments","statuses_url":"https://api.github.com/repos/bardsoftware/papeeria/statuses/a197b6e1f82925c14798e018e0060fd01779370f","head":{"label":"bardsoftware:tkt_8_convert_hunspell_to_json","ref":"tkt_8_convert_hunspell_to_json","sha":"a197b6e1f82925c14798e018e0060fd01779370f","user":{"login":"bardsoftware","id":2625618,"avatar_url":"https://avatars.githubusercontent.com/u/2625618?v=3","gravatar_id":"","url":"https://api.github.com/users/bardsoftware","html_url":"https://github.com/bardsoftware","followers_url":"https://api.github.com/users/bardsoftware/followers","following_url":"https://api.github.com/users/bardsoftware/following{/other_user}","gists_url":"https://api.github.com/users/bardsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/bardsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bardsoftware/subscriptions","organizations_url":"https://api.github.com/users/bardsoftware/orgs","repos_url":"https://api.github.com/users/bardsoftware/repos","events_url":"https://api.github.com/users/bardsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/bardsoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":6342268,"name":"papeeria","full_name":"bardsoftware/papeeria","owner":{"login":"bardsoftware","id":2625618,"avatar_url":"https://avatars.githubusercontent.com/u/2625618?v=3","gravatar_id":"","url":"https://api.github.com/users/bardsoftware","html_url":"https://github.com/bardsoftware","followers_url":"https://api.github.com/users/bardsoftware/followers","following_url":"https://api.github.com/users/bardsoftware/following{/other_user}","gists_url":"https://api.github.com/users/bardsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/bardsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bardsoftware/subscriptions","organizations_url":"https://api.github.com/users/bardsoftware/orgs","repos_url":"https://api.github.com/users/bardsoftware/repos","events_url":"https://api.github.com/users/bardsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/bardsoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bardsoftware/papeeria","description":"Papeeria repository","fork":false,"url":"https://api.github.com/repos/bardsoftware/papeeria","forks_url":"https://api.github.com/repos/bardsoftware/papeeria/forks","keys_url":"https://api.github.com/repos/bardsoftware/papeeria/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bardsoftware/papeeria/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bardsoftware/papeeria/teams","hooks_url":"https://api.github.com/repos/bardsoftware/papeeria/hooks","issue_events_url":"https://api.github.com/repos/bardsoftware/papeeria/issues/events{/number}","events_url":"https://api.github.com/repos/bardsoftware/papeeria/events","assignees_url":"https://api.github.com/repos/bardsoftware/papeeria/assignees{/user}","branches_url":"https://api.github.com/repos/bardsoftware/papeeria/branches{/branch}","tags_url":"https://api.github.com/repos/bardsoftware/papeeria/tags","blobs_url":"https://api.github.com/repos/bardsoftware/papeeria/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bardsoftware/papeeria/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bardsoftware/papeeria/git/refs{/sha}","trees_url":"https://api.github.com/repos/bardsoftware/papeeria/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bardsoftware/papeeria/statuses/{sha}","languages_url":"https://api.github.com/repos/bardsoftware/papeeria/languages","stargazers_url":"https://api.github.com/repos/bardsoftware/papeeria/stargazers","contributors_url":"https://api.github.com/repos/bardsoftware/papeeria/contributors","subscribers_url":"https://api.github.com/repos/bardsoftware/papeeria/subscribers","subscription_url":"https://api.github.com/repos/bardsoftware/papeeria/subscription","commits_url":"https://api.github.com/repos/bardsoftware/papeeria/commits{/sha}","git_commits_url":"https://api.github.com/repos/bardsoftware/papeeria/git/commits{/sha}","comments_url":"https://api.github.com/repos/bardsoftware/papeeria/comments{/number}","issue_comment_url":"https://api.github.com/repos/bardsoftware/papeeria/issues/comments{/number}","contents_url":"https://api.github.com/repos/bardsoftware/papeeria/contents/{+path}","compare_url":"https://api.github.com/repos/bardsoftware/papeeria/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bardsoftware/papeeria/merges","archive_url":"https://api.github.com/repos/bardsoftware/papeeria/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bardsoftware/papeeria/downloads","issues_url":"https://api.github.com/repos/bardsoftware/papeeria/issues{/number}","pulls_url":"https://api.github.com/repos/bardsoftware/papeeria/pulls{/number}","milestones_url":"https://api.github.com/repos/bardsoftware/papeeria/milestones{/number}","notifications_url":"https://api.github.com/repos/bardsoftware/papeeria/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bardsoftware/papeeria/labels{/name}","releases_url":"https://api.github.com/repos/bardsoftware/papeeria/releases{/id}","deployments_url":"https://api.github.com/repos/bardsoftware/papeeria/deployments","created_at":"2012-10-22T21:00:09Z","updated_at":"2015-01-08T23:27:07Z","pushed_at":"2016-08-11T12:05:17Z","git_url":"git://github.com/bardsoftware/papeeria.git","ssh_url":"git@github.com:bardsoftware/papeeria.git","clone_url":"https://github.com/bardsoftware/papeeria.git","svn_url":"https://github.com/bardsoftware/papeeria","homepage":null,"size":74500,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":1,"default_branch":"master"}},"base":{"label":"bardsoftware:master","ref":"master","sha":"9adf5a0fe521fe6263afe001ebeb9204ca7dbbfb","user":{"login":"bardsoftware","id":2625618,"avatar_url":"https://avatars.githubusercontent.com/u/2625618?v=3","gravatar_id":"","url":"https://api.github.com/users/bardsoftware","html_url":"https://github.com/bardsoftware","followers_url":"https://api.github.com/users/bardsoftware/followers","following_url":"https://api.github.com/users/bardsoftware/following{/other_user}","gists_url":"https://api.github.com/users/bardsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/bardsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bardsoftware/subscriptions","organizations_url":"https://api.github.com/users/bardsoftware/orgs","repos_url":"https://api.github.com/users/bardsoftware/repos","events_url":"https://api.github.com/users/bardsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/bardsoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":6342268,"name":"papeeria","full_name":"bardsoftware/papeeria","owner":{"login":"bardsoftware","id":2625618,"avatar_url":"https://avatars.githubusercontent.com/u/2625618?v=3","gravatar_id":"","url":"https://api.github.com/users/bardsoftware","html_url":"https://github.com/bardsoftware","followers_url":"https://api.github.com/users/bardsoftware/followers","following_url":"https://api.github.com/users/bardsoftware/following{/other_user}","gists_url":"https://api.github.com/users/bardsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/bardsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bardsoftware/subscriptions","organizations_url":"https://api.github.com/users/bardsoftware/orgs","repos_url":"https://api.github.com/users/bardsoftware/repos","events_url":"https://api.github.com/users/bardsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/bardsoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bardsoftware/papeeria","description":"Papeeria repository","fork":false,"url":"https://api.github.com/repos/bardsoftware/papeeria","forks_url":"https://api.github.com/repos/bardsoftware/papeeria/forks","keys_url":"https://api.github.com/repos/bardsoftware/papeeria/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bardsoftware/papeeria/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bardsoftware/papeeria/teams","hooks_url":"https://api.github.com/repos/bardsoftware/papeeria/hooks","issue_events_url":"https://api.github.com/repos/bardsoftware/papeeria/issues/events{/number}","events_url":"https://api.github.com/repos/bardsoftware/papeeria/events","assignees_url":"https://api.github.com/repos/bardsoftware/papeeria/assignees{/user}","branches_url":"https://api.github.com/repos/bardsoftware/papeeria/branches{/branch}","tags_url":"https://api.github.com/repos/bardsoftware/papeeria/tags","blobs_url":"https://api.github.com/repos/bardsoftware/papeeria/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bardsoftware/papeeria/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bardsoftware/papeeria/git/refs{/sha}","trees_url":"https://api.github.com/repos/bardsoftware/papeeria/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bardsoftware/papeeria/statuses/{sha}","languages_url":"https://api.github.com/repos/bardsoftware/papeeria/languages","stargazers_url":"https://api.github.com/repos/bardsoftware/papeeria/stargazers","contributors_url":"https://api.github.com/repos/bardsoftware/papeeria/contributors","subscribers_url":"https://api.github.com/repos/bardsoftware/papeeria/subscribers","subscription_url":"https://api.github.com/repos/bardsoftware/papeeria/subscription","commits_url":"https://api.github.com/repos/bardsoftware/papeeria/commits{/sha}","git_commits_url":"https://api.github.com/repos/bardsoftware/papeeria/git/commits{/sha}","comments_url":"https://api.github.com/repos/bardsoftware/papeeria/comments{/number}","issue_comment_url":"https://api.github.com/repos/bardsoftware/papeeria/issues/comments{/number}","contents_url":"https://api.github.com/repos/bardsoftware/papeeria/contents/{+path}","compare_url":"https://api.github.com/repos/bardsoftware/papeeria/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bardsoftware/papeeria/merges","archive_url":"https://api.github.com/repos/bardsoftware/papeeria/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bardsoftware/papeeria/downloads","issues_url":"https://api.github.com/repos/bardsoftware/papeeria/issues{/number}","pulls_url":"https://api.github.com/repos/bardsoftware/papeeria/pulls{/number}","milestones_url":"https://api.github.com/repos/bardsoftware/papeeria/milestones{/number}","notifications_url":"https://api.github.com/repos/bardsoftware/papeeria/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bardsoftware/papeeria/labels{/name}","releases_url":"https://api.github.com/repos/bardsoftware/papeeria/releases{/id}","deployments_url":"https://api.github.com/repos/bardsoftware/papeeria/deployments","created_at":"2012-10-22T21:00:09Z","updated_at":"2015-01-08T23:27:07Z","pushed_at":"2016-08-11T12:05:17Z","git_url":"git://github.com/bardsoftware/papeeria.git","ssh_url":"git@github.com:bardsoftware/papeeria.git","clone_url":"https://github.com/bardsoftware/papeeria.git","svn_url":"https://github.com/bardsoftware/papeeria","homepage":null,"size":74500,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bardsoftware/papeeria/pulls/9"},"html":{"href":"https://github.com/bardsoftware/papeeria/pull/9"},"issue":{"href":"https://api.github.com/repos/bardsoftware/papeeria/issues/9"},"comments":{"href":"https://api.github.com/repos/bardsoftware/papeeria/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/bardsoftware/papeeria/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/bardsoftware/papeeria/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bardsoftware/papeeria/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/bardsoftware/papeeria/statuses/a197b6e1f82925c14798e018e0060fd01779370f"}}}}
{"actor":{"display_login":"dbarashev"}}