Git Product home page Git Product logo

cykalgorithm's Introduction

cykAlgorithm

This CYK (Cocke-Younger-Kasami) parser is a Python program that demonstrates parsing a sentence using a Context-Free Grammar (CFG) represented in Chomsky Normal Form (CNF). It utilizes the provided Python files and a JSON configuration file to perform the parsing. The CNF conversion is done by the CNFConverter class in chomsky.py, and the CYK parsing is performed in cyk.py.

Files

  • main.py: The main Python script that loads the CFG from the input.json file, converts it to CNF, and then performs CYK parsing on a sample sentence.
  • chomsky.py: The Python module responsible for the CNF conversion of the provided CFG.
  • cyk.py: The Python module that implements the CYK parsing algorithm.
  • input.json: The JSON configuration file containing the CFG in CNF format.

How to Use

To run the CYK parser for the given CFG, follow these steps:

  1. Clone this repository to your local machine:

    git clone https://github.com/bl33h/CYK-Parser
    cd src
    python main.py
    

cykalgorithm's People

Contributors

bl33h avatar melissaperez09 avatar ortegarehbach avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

melissaperez09

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.