0.1.12 • Published 5 months ago

textbuddy v0.1.12

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

⚠️ Warning

This is a new module under active development. It is adviced to wait until version 1.0.0 before using this package in a production enviromment.

See Known issues for more information.

TextBuddy

TextBuddy is a JavaScript module for text analyzis. TextBuddy can assist you with a wide range of tasks - from simple character and word count to chatbot integration with OpenAi's API.

It was created and is maintained by a student at Linnaeus University in Sweden as part of an assignment in the course "Introduction to software quality".

Once the module reaches version 1.0.0, it will be suitable for use by any project that needs a simple, dependency-free, and modern module for analyzing text.

Table of contents

Example usage

const text = new TextBuddy('This is a text in English. It consists of eleven words.')
const wordCount = text.wordCount() // Output: 11

text.setOpenAiApiKey('your-api-key')

try {  
    const language = await text.aiGetLanguage() // Output: en  
} catch (error) {
      console.log(error.message)
}

TextBuddy web application

The TextBuddy javascript module is the engine driving a TextBuddy web application where users can get instant insights about their text.

The TextBuddy web application and TextBuddy javascript module are both part of a student project, but are completely stand alone projects.

The TextBuddy web application is an product implementation of the TextBuddy javascript module. The javascript module by itself does not have any frontend, and can be used in any type of project.

The web application can be seen as one example of what the javascript module is capable of.

TextBuddy web application: https://textbuddy.aihonen.se
Repository for web application: https://github.com/ta223dh/TextBuddy-Application

Getting started

Using the module:

  • Installation: npm i textbuddy

Developing the module:

  • git clone the project repo to your local folder
  • cd TextBuddy to navigage into the folder
  • npm install to install eslint for code standard and ava for unit tests
  • code . to open the project in your code editor
  • Unit tests: npm run test
  • Check lint issues: npm run lint
  • Automatically fix lint issues (if possible): npm run lint:fix

Component code: src/TextBuddy/textbuddy.js

Unit tests: src/tests/textbuddy.test.js

  • Set your API key in Test11 to test the Ai features.

Dependencies

Basic features:

  • TextBuddy is created from the ground up without any dependency on external libraries. The code is all written in modern javascript.

Chatbot integration:

  • Provide your own API key, and TextBuddy will be able to utilize OpenAi's API for chat completion. This will require a network call to OpenAi's servers. For costs, limitations, and privacy policy, refer to your OpenAI license agreement.

https://platform.openai.com/account/api-keys

Features and documentation

Basic

Ai

Known issues

TextBuddy

  • Handle special characters TB-1
  • The word counter should not count line breaks and tabs as words. TB-2

Version history

See version history

Test reports

See test reports

Do you want to contribute to the project?

Create an issue on github to report a bug or suggest a new feature. Make a Pull request to contribute new code. Check the issue list to see if there already is an existing issue before creating a new one.

Bug report:

  • Explain the steps to reproduce, actual behaviour and expected behaviour
  • Module version (for example TextBuddy 0.0.12)
  • Environment (for example Nodejs 18.18.0 LTS or Firefox 118.0).

Feature request:

  • Explain the feature, expected input and output, and why it is needed.

Pull requests:

For code contributions, the following requirements must be fullfilled:

  • Feature or bug has been described in an existing issue
  • Code is documented with JSDoc
  • Code is using modern javascript syntax (ECMAScript 6 and later)
  • No dependencies on third party modules
  • Unit tests are added for the new feature
  • Unit tests (new and old) run with 0 failures
  • Linting runs with 0 warnings

A code review will then be conducted by the repository owner before merging.

0.1.10

5 months ago

0.1.11

5 months ago

0.1.12

5 months ago

0.1.8

5 months ago

0.1.7

5 months ago

0.1.9

5 months ago

0.1.6

5 months ago

0.1.4

7 months ago

0.1.2

7 months ago

0.1.1

7 months ago

0.1.0

8 months ago

0.0.12

8 months ago

0.0.11

8 months ago

0.0.10

8 months ago

0.0.9

8 months ago

0.0.8

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago

0.0.0

8 months ago