@kingdanx/dap-translate
v1.0.17
Published
Downloads
60
Readme
dap-translate
A lightweight translation service that leverages transformer models (via transformers.js) to translate English text into multiple languages.
Features
- Language Support: Translate English text into multiple languages.
- Powered by transformers.js: Utilizes transformer models for accurate translations.
- Lightweight and modular: Core logic separated into modules for easy maintenance.
Project Structure
.
├── language-models/ # Pre-trained language models
├── models/ # Model configurations and utilities
├── modules/ # Core translation logic
├── test/ # Unit and integration tests
├── build/ # Build scripts and configurations
├── .gitignore # Git ignore rules
├── LICENSE # Project license
├── README.md # Project documentation
└── package.json # Project metadata and dependenciesInstallation
- Clone the repository:
git clone https://github.com/KingDanx/dap-translate.git
cd dap-translate- Install dependencies:
bun installOR
bun install @kingdanx/dap-translateOR
npm install @kingdanx/dap-translateUsage
import { translate } from 'dap-translate';
const translatedText = await translate('Hello, world!', 'es');
console.log(translatedText); // Output: '¡Hola, mundo!'Supported languages are based on the models available in the language-models directory.
Testing
Run the test suite:
bun testLicense
MIT License – see the LICENSE file for details.
Contributing
Contributions are welcome! Please fork the repository and submit pull requests for any improvements or fixes.
