|
5 | 5 |
|
6 | 6 | > Natural language processing tools, powered by Demo Macro. |
7 | 7 |
|
| 8 | +## Introduction |
| 9 | + |
| 10 | +NLPTools is a comprehensive collection of natural language processing utilities designed to simplify text analysis, comparison, and manipulation. The project is structured as a monorepo with multiple specialized packages that can be used together or independently. |
| 11 | + |
| 12 | +## Features |
| 13 | + |
| 14 | +- **Text Similarity**: Multiple algorithms for measuring text similarity (Levenshtein, Jaccard, Cosine) |
| 15 | +- **Text Comparison**: Tools for comparing and finding differences between texts |
| 16 | +- **Text Segmentation**: Utilities for breaking text into paragraphs, sentences, phrases, and words |
| 17 | +- **Language Support**: Support for multiple languages with automatic language detection |
| 18 | +- **Modular Design**: Use only what you need with independent packages |
| 19 | + |
| 20 | +## Installation |
| 21 | + |
| 22 | +```bash |
| 23 | +# Install the main package with all utilities |
| 24 | +pnpm install @nlptools/nlptools |
| 25 | + |
| 26 | +# Or install individual packages as needed |
| 27 | +pnpm install @nlptools/similarity |
| 28 | +pnpm install @nlptools/comparison |
| 29 | +pnpm install @nlptools/segmentation |
| 30 | +pnpm install @nlptools/core |
| 31 | +``` |
| 32 | + |
| 33 | +## Quick Start |
| 34 | + |
| 35 | +```ts |
| 36 | +// Import from the main package |
| 37 | +import { |
| 38 | + createSimilarityMeasure, |
| 39 | + createComparator, |
| 40 | + createSegmenter, |
| 41 | +} from "@nlptools/nlptools"; |
| 42 | + |
| 43 | +// Calculate text similarity |
| 44 | +const similarity = createSimilarityMeasure("levenshtein").calculate( |
| 45 | + "Hello world", |
| 46 | + "Hello there", |
| 47 | +); |
| 48 | +console.log(`Similarity: ${similarity.similarity}`); |
| 49 | + |
| 50 | +// Compare texts and get differences |
| 51 | +const diff = createComparator("diff").compare("Hello world", "Hello there"); |
| 52 | +console.log(diff.differences); |
| 53 | + |
| 54 | +// Segment text into sentences |
| 55 | +const sentences = createSegmenter("sentences").segment( |
| 56 | + "Hello world! How are you today?", |
| 57 | +); |
| 58 | +console.log(sentences.segments); |
| 59 | +``` |
| 60 | + |
8 | 61 | ## Packages |
9 | 62 |
|
10 | | -- [nlptools](./packages/nlptools/README.md) |
11 | | -- [@nlptools/comparison](./packages/comparison/README.md) |
12 | | -- [@nlptools/segmentation](./packages/segmentation/README.md) |
13 | | -- [@nlptools/similarity](./packages/similarity/README.md) |
| 63 | +- [nlptools](./packages/nlptools/README.md) - Main package that includes all modules |
| 64 | +- [@nlptools/similarity](./packages/similarity/README.md) - Text similarity algorithms |
| 65 | +- [@nlptools/comparison](./packages/comparison/README.md) - Text comparison utilities |
| 66 | +- [@nlptools/segmentation](./packages/segmentation/README.md) - Text segmentation tools |
| 67 | +- [@nlptools/core](./packages/core/README.md) - Core utilities and interfaces |
| 68 | + |
| 69 | +## Documentation |
| 70 | + |
| 71 | +Each package contains detailed documentation and examples. See the individual package READMEs for more information. |
| 72 | + |
| 73 | +## Contributing |
| 74 | + |
| 75 | +Contributions are welcome! Please feel free to submit a Pull Request. |
14 | 76 |
|
15 | 77 | ## License |
16 | 78 |
|
|
0 commit comments