{"id":18612502,"url":"https://github.com/alejandro945/cyk-algorithm-server","last_synced_at":"2025-11-03T00:30:25.484Z","repository":{"id":69072065,"uuid":"552664478","full_name":"alejandro945/cyk-algorithm-server","owner":"alejandro945","description":"In computer science, the Cocke–Younger–Kasami algorithm (alternatively called CYK, or CKY) is a parsing algorithm for context-free grammars published by Itiroo Sakai in 1961.","archived":false,"fork":false,"pushed_at":"2022-11-07T06:08:15.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-27T02:21:35.789Z","etag":null,"topics":["cyk-algorithm","rails-api","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alejandro945.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-17T03:09:41.000Z","updated_at":"2022-10-17T03:12:03.000Z","dependencies_parsed_at":"2023-03-23T09:03:07.990Z","dependency_job_id":null,"html_url":"https://github.com/alejandro945/cyk-algorithm-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandro945%2Fcyk-algorithm-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandro945%2Fcyk-algorithm-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandro945%2Fcyk-algorithm-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandro945%2Fcyk-algorithm-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alejandro945","download_url":"https://codeload.github.com/alejandro945/cyk-algorithm-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239403678,"owners_count":19632628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cyk-algorithm","rails-api","ruby"],"created_at":"2024-11-07T03:17:38.189Z","updated_at":"2025-11-03T00:30:25.437Z","avatar_url":"https://github.com/alejandro945.png","language":"Ruby","readme":"[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://travis-ci.org/joemccann/dillinger)\n\n# Rails CYK Rest API 🧶\n\n## Project Setup\n\n**Install all gems**:\n\n```console\n$ bundle install\n```\n\n**Update the database with new data model**:\n\n```console\n$ rails db:migrate\n```\n\n**Feed the database with default seeds**:\n\n```console\n$ rails db:seed\n```\n\n**Start the web server on `http://localhost:3000` by default**:\n\n```console\n$ rails server\n```\n\n**Run all RSpec tests and Rubocop**:\n\n```console\n$ rails test\n```\n\n## Usage\n\n| HTTP verbs | Paths  | Used for |\n| ---------- | ------ | --------:|\n| POST | api/v1/responses   | Determintes if w is generated by G|\n| GET | api/v1/responses    | List all responses - **DEPRECATED**|\n\n## Use Case Examples\n\n### CYK Algorithm\n\n**Boolean Output: w ∈ L(G) only if S ∈ X1n.**:\n\n```console\n$ curl -X POST -H 'Content-type: application/json' -d '{}' localhost:3000/api/v1/responses\n```\n#### Json Input\n```json\n{\n    \"grammar\": [\n        {\n        \"producer\": \"S\",\n        \"products\": [\"BA\", \"A\"]\n        },\n        {\n        \"producer\": \"A\",\n        \"products\": [\"CA\",\"a\"]\n        },\n        {\n        \"producer\": \"B\",\n        \"products\": [\"BB\",\"b\"]\n        },\n        {\n        \"producer\": \"C\",\n        \"products\": [\"BA\", \"c\"]\n        }\n    ],\n    \"word\": \"bca\"\n}\n```\n#### Json Output\n```json\n{\n    \"id\": 12,\n    \"word\": \"bca\",\n    \"isAdmitted\": true,\n    \"created_at\": \"2022-10-18T02:14:45.389Z\",\n    \"updated_at\": \"2022-10-18T02:14:45.389Z\"\n}\n```\n#### New Response From Slides Example \n```json\n{\n    \"response\": true,\n    \"matrix\": [\n        [\n            [\n                \"A\"\n            ],\n            [\n                [\n                    \"A\"\n                ]\n            ],\n            [\n                [],\n                [\n                    \"S\"\n                ]\n            ]\n        ],\n        [\n            [\n                \"A\"\n            ],\n            [\n                [\n                    \"S\"\n                ]\n            ],\n            null\n        ],\n        [\n            [\n                \"B\"\n            ],\n            null,\n            null\n        ]\n    ]\n}\n```\n\n**Get responses in postgress database**:\n\n```console\n$ curl localhost:3000/api/v1/responses\n```\n#### Json Output\n```json\n[\n    {\n        \"id\": 8,\n        \"word\": \"bbab\",\n        \"isAdmitted\": true,\n        \"created_at\": \"2022-10-18T01:50:28.200Z\",\n        \"updated_at\": \"2022-10-18T01:50:28.200Z\"\n    },\n    {\n        \"id\": 9,\n        \"word\": \"bbab\",\n        \"isAdmitted\": true,\n        \"created_at\": \"2022-10-18T01:53:37.901Z\",\n        \"updated_at\": \"2022-10-18T01:53:37.901Z\"\n    },\n    {\n        \"id\": 10,\n        \"word\": \"aab\",\n        \"isAdmitted\": true,\n        \"created_at\": \"2022-10-18T01:54:40.336Z\",\n        \"updated_at\": \"2022-10-18T01:54:40.336Z\"\n    },\n    {\n        \"id\": 11,\n        \"word\": \"aab\",\n        \"isAdmitted\": true,\n        \"created_at\": \"2022-10-18T01:55:11.980Z\",\n        \"updated_at\": \"2022-10-18T01:55:11.980Z\"\n    },\n    {\n        \"id\": 12,\n        \"word\": \"bca\",\n        \"isAdmitted\": true,\n        \"created_at\": \"2022-10-18T02:14:45.389Z\",\n        \"updated_at\": \"2022-10-18T02:14:45.389Z\"\n    }\n]\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandro945%2Fcyk-algorithm-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falejandro945%2Fcyk-algorithm-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandro945%2Fcyk-algorithm-server/lists"}