Skip to content

idafurjes/lexical_density

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Lexical Density API

I created an API that counts the lexical density of the input body.

For testing purposes I created a MongoDB database that store a short list of nonlexical words. POST requests are used instead of GET because the API is reading req.body (in this case using GET method is not fully compliant with HTTP specification).

On an http POST/complexity request the output will be the the lexical density of the body of the request.

Example input: This is very cool. In this case there are 2 nonlexical words : This + is, and 2 lexical : very + cool. The count of lexical words is 50%. The output will be: {data: {overall_ld: 0.5}}

On POST/complexity?mode=verbose the output will also contain the lexical density pro sentence.

Exaple input: This is very cool. I like dogs and cats. In this case the lexical words are: very, cool, like, dogs, cats and the nonlexical: this, is, I, and. Where the output will be folowing: {data : {overall_ld: 0.56}{sentence_ld : [0.5, 0.6]}}

Testing with MongoDB in Docker

For testing purposes, it is possible to run the MongoDB in docker by executing following command and mounting the /data folder from the repository as volume (-v flag):

docker run --name test-mongo -v /path/to/data/:/data/db -p 27017:27017 -d mongo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published