{"action":"created","comment":{"url":"https://api.github.com/repos/molybdenum-99/spelleology/pulls/comments/221009676","pull_request_review_id":159554163,"id":221009676,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTAwOTY3Ng==","diff_hunk":"@@ -0,0 +1,38 @@\n+module Parsers\n+  class AffParser\n+    AFFIX_REGEX = /^(PFX|SFX)(\\s|\\w|.)*/\n+    AFFIX_GROUP_REGEX = /^(PFX|SFX)\\s\\w/\n+\n+    def initialize(file)\n+      @file = file\n+    end\n+\n+    def parse\n+      {}.tap do |res|\n+        res[:affixes] = @file.to_a\n+                             .map { |ln| ln.tr(\"\\n\\t\", '') }\n+                             .grep(AFFIX_REGEX)\n+                             .group_by { |el| el[AFFIX_GROUP_REGEX] }.values\n+                             .map(&method(:parse_affix_line))\n+      end\n+    end\n+\n+    private\n+\n+    def parse_affix_line(aff_group)\n+      header = aff_group.first\n+      name, flag, cross_product, line_count = header.split(/[\\s*]/)\n+      rules = aff_group[1..-1].each_with_object([]) do |el, arr|\n+        _, _, stripping_rule, affixes, condition = el.split(/[\\s*]/)\n+        arr << { stripping_rule: stripping_rule, affixes: affixes, condition: condition }\n+      end","path":"lib/parsers/aff_parser.rb","position":28,"original_position":28,"commit_id":"98cf2c5ca205db57002e83a4e8a6fcf42660f90e","original_commit_id":"98cf2c5ca205db57002e83a4e8a6fcf42660f90e","user":{"login":"zverok","id":129656,"node_id":"MDQ6VXNlcjEyOTY1Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/129656?v=4","gravatar_id":"","url":"https://api.github.com/users/zverok","html_url":"https://github.com/zverok","followers_url":"https://api.github.com/users/zverok/followers","following_url":"https://api.github.com/users/zverok/following{/other_user}","gists_url":"https://api.github.com/users/zverok/gists{/gist_id}","starred_url":"https://api.github.com/users/zverok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zverok/subscriptions","organizations_url":"https://api.github.com/users/zverok/orgs","repos_url":"https://api.github.com/users/zverok/repos","events_url":"https://api.github.com/users/zverok/events{/privacy}","received_events_url":"https://api.github.com/users/zverok/received_events","type":"User","site_admin":false},"body":"That's just map (instead of `each_with_object([])` and `<<`)","created_at":"2018-09-27T17:25:18Z","updated_at":"2018-09-27T17:35:56Z","html_url":"https://github.com/molybdenum-99/spelleology/pull/1#discussion_r221009676","pull_request_url":"https://api.github.com/repos/molybdenum-99/spelleology/pulls/1","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/molybdenum-99/spelleology/pulls/comments/221009676"},"html":{"href":"https://github.com/molybdenum-99/spelleology/pull/1#discussion_r221009676"},"pull_request":{"href":"https://api.github.com/repos/molybdenum-99/spelleology/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/molybdenum-99/spelleology/pulls/1","id":197933113,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3OTMzMTEz","html_url":"https://github.com/molybdenum-99/spelleology/pull/1","diff_url":"https://github.com/molybdenum-99/spelleology/pull/1.diff","patch_url":"https://github.com/molybdenum-99/spelleology/pull/1.patch","issue_url":"https://api.github.com/repos/molybdenum-99/spelleology/issues/1","number":1,"state":"open","locked":false,"title":"Dictionary and dictionary reader","user":{"login":"frolmr","id":11319606,"node_id":"MDQ6VXNlcjExMzE5NjA2","avatar_url":"https://avatars2.githubusercontent.com/u/11319606?v=4","gravatar_id":"","url":"https://api.github.com/users/frolmr","html_url":"https://github.com/frolmr","followers_url":"https://api.github.com/users/frolmr/followers","following_url":"https://api.github.com/users/frolmr/following{/other_user}","gists_url":"https://api.github.com/users/frolmr/gists{/gist_id}","starred_url":"https://api.github.com/users/frolmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frolmr/subscriptions","organizations_url":"https://api.github.com/users/frolmr/orgs","repos_url":"https://api.github.com/users/frolmr/repos","events_url":"https://api.github.com/users/frolmr/events{/privacy}","received_events_url":"https://api.github.com/users/frolmr/received_events","type":"User","site_admin":false},"body":"Add `class Dictionary` for dictionary objects, `class DictionaryReader` for parsing .dic and .aff files and instantiating Dictionary object.","created_at":"2018-06-28T06:54:00Z","updated_at":"2018-09-27T17:35:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1baae7ba08aea92306fcca4df212f85e8b94b4a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/molybdenum-99/spelleology/pulls/1/commits","review_comments_url":"https://api.github.com/repos/molybdenum-99/spelleology/pulls/1/comments","review_comment_url":"https://api.github.com/repos/molybdenum-99/spelleology/pulls/comments{/number}","comments_url":"https://api.github.com/repos/molybdenum-99/spelleology/issues/1/comments","statuses_url":"https://api.github.com/repos/molybdenum-99/spelleology/statuses/98cf2c5ca205db57002e83a4e8a6fcf42660f90e","head":{"label":"frolmr:dictionary_and_dictionary_reader","ref":"dictionary_and_dictionary_reader","sha":"98cf2c5ca205db57002e83a4e8a6fcf42660f90e","user":{"login":"frolmr","id":11319606,"node_id":"MDQ6VXNlcjExMzE5NjA2","avatar_url":"https://avatars2.githubusercontent.com/u/11319606?v=4","gravatar_id":"","url":"https://api.github.com/users/frolmr","html_url":"https://github.com/frolmr","followers_url":"https://api.github.com/users/frolmr/followers","following_url":"https://api.github.com/users/frolmr/following{/other_user}","gists_url":"https://api.github.com/users/frolmr/gists{/gist_id}","starred_url":"https://api.github.com/users/frolmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frolmr/subscriptions","organizations_url":"https://api.github.com/users/frolmr/orgs","repos_url":"https://api.github.com/users/frolmr/repos","events_url":"https://api.github.com/users/frolmr/events{/privacy}","received_events_url":"https://api.github.com/users/frolmr/received_events","type":"User","site_admin":false},"repo":{"id":138972173,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg5NzIxNzM=","name":"spelleology","full_name":"frolmr/spelleology","private":false,"owner":{"login":"frolmr","id":11319606,"node_id":"MDQ6VXNlcjExMzE5NjA2","avatar_url":"https://avatars2.githubusercontent.com/u/11319606?v=4","gravatar_id":"","url":"https://api.github.com/users/frolmr","html_url":"https://github.com/frolmr","followers_url":"https://api.github.com/users/frolmr/followers","following_url":"https://api.github.com/users/frolmr/following{/other_user}","gists_url":"https://api.github.com/users/frolmr/gists{/gist_id}","starred_url":"https://api.github.com/users/frolmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frolmr/subscriptions","organizations_url":"https://api.github.com/users/frolmr/orgs","repos_url":"https://api.github.com/users/frolmr/repos","events_url":"https://api.github.com/users/frolmr/events{/privacy}","received_events_url":"https://api.github.com/users/frolmr/received_events","type":"User","site_admin":false},"html_url":"https://github.com/frolmr/spelleology","description":null,"fork":true,"url":"https://api.github.com/repos/frolmr/spelleology","forks_url":"https://api.github.com/repos/frolmr/spelleology/forks","keys_url":"https://api.github.com/repos/frolmr/spelleology/keys{/key_id}","collaborators_url":"https://api.github.com/repos/frolmr/spelleology/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/frolmr/spelleology/teams","hooks_url":"https://api.github.com/repos/frolmr/spelleology/hooks","issue_events_url":"https://api.github.com/repos/frolmr/spelleology/issues/events{/number}","events_url":"https://api.github.com/repos/frolmr/spelleology/events","assignees_url":"https://api.github.com/repos/frolmr/spelleology/assignees{/user}","branches_url":"https://api.github.com/repos/frolmr/spelleology/branches{/branch}","tags_url":"https://api.github.com/repos/frolmr/spelleology/tags","blobs_url":"https://api.github.com/repos/frolmr/spelleology/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/frolmr/spelleology/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/frolmr/spelleology/git/refs{/sha}","trees_url":"https://api.github.com/repos/frolmr/spelleology/git/trees{/sha}","statuses_url":"https://api.github.com/repos/frolmr/spelleology/statuses/{sha}","languages_url":"https://api.github.com/repos/frolmr/spelleology/languages","stargazers_url":"https://api.github.com/repos/frolmr/spelleology/stargazers","contributors_url":"https://api.github.com/repos/frolmr/spelleology/contributors","subscribers_url":"https://api.github.com/repos/frolmr/spelleology/subscribers","subscription_url":"https://api.github.com/repos/frolmr/spelleology/subscription","commits_url":"https://api.github.com/repos/frolmr/spelleology/commits{/sha}","git_commits_url":"https://api.github.com/repos/frolmr/spelleology/git/commits{/sha}","comments_url":"https://api.github.com/repos/frolmr/spelleology/comments{/number}","issue_comment_url":"https://api.github.com/repos/frolmr/spelleology/issues/comments{/number}","contents_url":"https://api.github.com/repos/frolmr/spelleology/contents/{+path}","compare_url":"https://api.github.com/repos/frolmr/spelleology/compare/{base}...{head}","merges_url":"https://api.github.com/repos/frolmr/spelleology/merges","archive_url":"https://api.github.com/repos/frolmr/spelleology/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/frolmr/spelleology/downloads","issues_url":"https://api.github.com/repos/frolmr/spelleology/issues{/number}","pulls_url":"https://api.github.com/repos/frolmr/spelleology/pulls{/number}","milestones_url":"https://api.github.com/repos/frolmr/spelleology/milestones{/number}","notifications_url":"https://api.github.com/repos/frolmr/spelleology/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/frolmr/spelleology/labels{/name}","releases_url":"https://api.github.com/repos/frolmr/spelleology/releases{/id}","deployments_url":"https://api.github.com/repos/frolmr/spelleology/deployments","created_at":"2018-06-28T05:50:34Z","updated_at":"2018-06-28T05:50:36Z","pushed_at":"2018-09-26T16:36:05Z","git_url":"git://github.com/frolmr/spelleology.git","ssh_url":"git@github.com:frolmr/spelleology.git","clone_url":"https://github.com/frolmr/spelleology.git","svn_url":"https://github.com/frolmr/spelleology","homepage":null,"size":20,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"molybdenum-99:master","ref":"master","sha":"24a0b54ff2016e4db6243f1b016e82140db628a2","user":{"login":"molybdenum-99","id":12218981,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMjE4OTgx","avatar_url":"https://avatars3.githubusercontent.com/u/12218981?v=4","gravatar_id":"","url":"https://api.github.com/users/molybdenum-99","html_url":"https://github.com/molybdenum-99","followers_url":"https://api.github.com/users/molybdenum-99/followers","following_url":"https://api.github.com/users/molybdenum-99/following{/other_user}","gists_url":"https://api.github.com/users/molybdenum-99/gists{/gist_id}","starred_url":"https://api.github.com/users/molybdenum-99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/molybdenum-99/subscriptions","organizations_url":"https://api.github.com/users/molybdenum-99/orgs","repos_url":"https://api.github.com/users/molybdenum-99/repos","events_url":"https://api.github.com/users/molybdenum-99/events{/privacy}","received_events_url":"https://api.github.com/users/molybdenum-99/received_events","type":"Organization","site_admin":false},"repo":{"id":102947552,"node_id":"MDEwOlJlcG9zaXRvcnkxMDI5NDc1NTI=","name":"spelleology","full_name":"molybdenum-99/spelleology","private":false,"owner":{"login":"molybdenum-99","id":12218981,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMjE4OTgx","avatar_url":"https://avatars3.githubusercontent.com/u/12218981?v=4","gravatar_id":"","url":"https://api.github.com/users/molybdenum-99","html_url":"https://github.com/molybdenum-99","followers_url":"https://api.github.com/users/molybdenum-99/followers","following_url":"https://api.github.com/users/molybdenum-99/following{/other_user}","gists_url":"https://api.github.com/users/molybdenum-99/gists{/gist_id}","starred_url":"https://api.github.com/users/molybdenum-99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/molybdenum-99/subscriptions","organizations_url":"https://api.github.com/users/molybdenum-99/orgs","repos_url":"https://api.github.com/users/molybdenum-99/repos","events_url":"https://api.github.com/users/molybdenum-99/events{/privacy}","received_events_url":"https://api.github.com/users/molybdenum-99/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/molybdenum-99/spelleology","description":null,"fork":false,"url":"https://api.github.com/repos/molybdenum-99/spelleology","forks_url":"https://api.github.com/repos/molybdenum-99/spelleology/forks","keys_url":"https://api.github.com/repos/molybdenum-99/spelleology/keys{/key_id}","collaborators_url":"https://api.github.com/repos/molybdenum-99/spelleology/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/molybdenum-99/spelleology/teams","hooks_url":"https://api.github.com/repos/molybdenum-99/spelleology/hooks","issue_events_url":"https://api.github.com/repos/molybdenum-99/spelleology/issues/events{/number}","events_url":"https://api.github.com/repos/molybdenum-99/spelleology/events","assignees_url":"https://api.github.com/repos/molybdenum-99/spelleology/assignees{/user}","branches_url":"https://api.github.com/repos/molybdenum-99/spelleology/branches{/branch}","tags_url":"https://api.github.com/repos/molybdenum-99/spelleology/tags","blobs_url":"https://api.github.com/repos/molybdenum-99/spelleology/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/molybdenum-99/spelleology/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/molybdenum-99/spelleology/git/refs{/sha}","trees_url":"https://api.github.com/repos/molybdenum-99/spelleology/git/trees{/sha}","statuses_url":"https://api.github.com/repos/molybdenum-99/spelleology/statuses/{sha}","languages_url":"https://api.github.com/repos/molybdenum-99/spelleology/languages","stargazers_url":"https://api.github.com/repos/molybdenum-99/spelleology/stargazers","contributors_url":"https://api.github.com/repos/molybdenum-99/spelleology/contributors","subscribers_url":"https://api.github.com/repos/molybdenum-99/spelleology/subscribers","subscription_url":"https://api.github.com/repos/molybdenum-99/spelleology/subscription","commits_url":"https://api.github.com/repos/molybdenum-99/spelleology/commits{/sha}","git_commits_url":"https://api.github.com/repos/molybdenum-99/spelleology/git/commits{/sha}","comments_url":"https://api.github.com/repos/molybdenum-99/spelleology/comments{/number}","issue_comment_url":"https://api.github.com/repos/molybdenum-99/spelleology/issues/comments{/number}","contents_url":"https://api.github.com/repos/molybdenum-99/spelleology/contents/{+path}","compare_url":"https://api.github.com/repos/molybdenum-99/spelleology/compare/{base}...{head}","merges_url":"https://api.github.com/repos/molybdenum-99/spelleology/merges","archive_url":"https://api.github.com/repos/molybdenum-99/spelleology/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/molybdenum-99/spelleology/downloads","issues_url":"https://api.github.com/repos/molybdenum-99/spelleology/issues{/number}","pulls_url":"https://api.github.com/repos/molybdenum-99/spelleology/pulls{/number}","milestones_url":"https://api.github.com/repos/molybdenum-99/spelleology/milestones{/number}","notifications_url":"https://api.github.com/repos/molybdenum-99/spelleology/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/molybdenum-99/spelleology/labels{/name}","releases_url":"https://api.github.com/repos/molybdenum-99/spelleology/releases{/id}","deployments_url":"https://api.github.com/repos/molybdenum-99/spelleology/deployments","created_at":"2017-09-09T10:33:55Z","updated_at":"2018-06-27T18:40:46Z","pushed_at":"2018-09-26T16:36:06Z","git_url":"git://github.com/molybdenum-99/spelleology.git","ssh_url":"git@github.com:molybdenum-99/spelleology.git","clone_url":"https://github.com/molybdenum-99/spelleology.git","svn_url":"https://github.com/molybdenum-99/spelleology","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/molybdenum-99/spelleology/pulls/1"},"html":{"href":"https://github.com/molybdenum-99/spelleology/pull/1"},"issue":{"href":"https://api.github.com/repos/molybdenum-99/spelleology/issues/1"},"comments":{"href":"https://api.github.com/repos/molybdenum-99/spelleology/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/molybdenum-99/spelleology/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/molybdenum-99/spelleology/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/molybdenum-99/spelleology/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/molybdenum-99/spelleology/statuses/98cf2c5ca205db57002e83a4e8a6fcf42660f90e"}},"author_association":"NONE"}}
{"actor":{"display_login":"zverok"}}