Giter VIP home page Giter VIP logo

ic-project-3's Introduction

Project 3: Finite Context Models

This project provides a makefile, so it can be easy to compile and run all of the programs present in this repository and a doxygen documentation. To use this documentation one just needs to run the following command while in the base folder of the repository:

firefox html/index.html

or

google-chrome html/index.html

In the previous commands "firefox" and "google-chrome" can be swapped to the name of the preferred web browser of the user. Alternatively the user can also open the html folder and open the index.html file with the browser of preference.

Contents of the repository

include folder

All of the ".h" files developed are in this folder.

lang_models

This folder holds all of the text files that represent various languages we selected to use during this project. If the user decides to add more languages it must add the representative text of that language in this folder.

texts

This folder holds all of the texts used to test the developed software of this project.

CPP Files

This project has 4 cpp files:

  • testFilter.cpp
  • test_lang.cpp
  • teste_fcm.cpp
  • findlang.cpp

The testFilter.cpp is used to filter the input text given, this is done by removing all numbers from the text and converting all characters to their lower case version.
The test_lang.cpp is used to get the number of bits necessary to compress the given text in the provided model.
The teste_fcm.cpp is used to get the entropy of the model text given and number of bits necessary to compress the given text in the provided model.
The findlang.cpp is used to determine in which language the given text is written in, this program will determine the amount of bits necessary to compress the given text in all of the models present in the "lang_models" folder, then it will choose the lower amount of bits and the language that matches that amount as the language the input text is written in.

Instructions

Compile all code:

make all

Compile specific file:

make teste_fcm
make testFilter
make test_lang
make findlang

Clean the repository (remove all executables):

make clean

How to run the programs

./test_lang.o lang_models/portuguese.txt texts/sample_texts/lusiadas.txt 3 0.1
./testFilter.o lang_models/portuguese.txt texts/portuguese_filtered.txt
./teste_fcm.o lang_models/portuguese.txt texts/sample_texts/lusiadas.txt 3 0.1

findlang.o

This program supports two modes of operation, filtered and not filtered and is necessary to specify which mode needs to be used while running the program by using -f for filtered mode and -nf for not filtered mode.

./findlang.o texts/sample_texts/lusiadas.txt 3 0.1 -f

or

./findlang.o texts/sample_texts/lusiadas.txt 3 0.1 -nf

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.