You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(.gitignore): add playground directory to ignore list
docs(README.md): update command examples to include 'translate' keyword
feat(formality.go): introduce formality settings for language translation
refactor: remove dragoman.go to refactor translation implementation
feat(improve.go): add document improvement functionality with SEO optimization
- Introduces `Improver` struct to enhance document content for engagement, clarity, and SEO.
- Implements `Improve` method to process documents in chunks for scalability.
- Utilizes parameters like formality, keywords, and language for tailored improvements.
- Supports splitting documents into manageable chunks for individual enhancement.
- Ensures structural integrity of documents by preserving formatting elements.
feat(cli.go): restructure CLI options for translate and improve commands
- Encapsulate translation-related options within a `Translate` struct and introduce a new `Improve` command with its own set of options. This change organizes the CLI options more logically, separating translation and improvement functionalities into distinct command groups for better user experience and code maintainability.
- Replace `Rules` option with `Instructions` in both `Translate` and `Improve` commands to better reflect the purpose of providing guidance to the translation or improvement process.
- Add `Formality`, `Keywords`, and `Language` options to the `Improve` command to support text improvement features, allowing users to specify the formality level, optimize for certain keywords, and set the language for the improvement process.
- Modify the `Run` function to handle the new command structure, ensuring the application correctly processes commands based on the provided arguments and executes the appropriate functionality.
- Implement `translate` and `improve` functions to encapsulate the logic for each command, improving code organization and making it easier to maintain and extend the application with new features in the future.
refactor(cli.go): restructure output file creation to use nested options
feat(cli.go): introduce `improve` function for document enhancement with OpenAI
refactor(cli.go): update `getChunks` function to accept parameters directly for improved clarity and flexibility
feat: add translation model and translator with tests
- Implement a chat-based translation model interface and a function type to facilitate easy translation model creation.
- Develop a Translator struct with methods to translate text documents, supporting chunk-based translation, preservation of specific terms, and custom translation instructions.
- Include comprehensive unit tests to validate translation functionality, including handling of source and target languages, preservation of terms, and proper prompt generation based on translation parameters.
@@ -125,7 +125,7 @@ option to only translate the newly added fields and merge them into the output f
125
125
```
126
126
127
127
```bash
128
-
dragoman en.json --out de.json --update
128
+
dragoman translate en.json --out de.json --update
129
129
```
130
130
131
131
Result:
@@ -146,7 +146,7 @@ Result:
146
146
This option allows you to specify a list of specific words or phrases, separated by commas, that you want to remain unchanged during the translation process. It's particularly useful for ensuring that certain terms, which may have significance in their original form or are used in specific contexts (like code, trademarks, or names), are not altered. These specified terms will be recognized and preserved whether they appear in isolation or as part of larger strings. This feature is especially handy for content that includes embedded terms within other elements, such as HTML tags. For instance, using --preserve ensures that a term like <spanclass="font-bold">Drago</span>man retains its original form post-translation. Note that the effectiveness of this feature may vary depending on the language model used, and it is optimized for use with OpenAI's GPT models.
0 commit comments