# Lexical diversity analyzer

- Human page: https://happytails.ai/en/text-tools/lexical-diversity-analyzer/
- Markdown: https://happytails.ai/en/text-tools/lexical-diversity-analyzer.md
- Structured JSON: https://happytails.ai/agents/en/text-tools/lexical-diversity-analyzer/index.json
- Visibility: public

## Tool capabilities

| Property | Value |
| --- | --- |
| Tool ID | `lexical-diversity-analyzer` |
| Category | text-tools |
| Implementation | Registered implementation. Registration alone is not a production-quality guarantee. |
| Browser execution | Use the visible action or interactive controls. |
| Browser processing | Browser; see tool notes for network behavior. |
| HTTP API | Not callable through HTTP. |
| Browser-agent interface | run_current_tool |

### Implementation notes

Word tokens are Intl.Segmenter word-like segments containing a Unicode letter; pure numbers are excluded. TTR = distinct words / words; root TTR = distinct words / square root of words; corrected TTR = distinct words / square root of twice the words. Moving-average TTR uses only complete selected-size windows. These length-sensitive descriptive ratios do not measure proficiency or writing quality. Use up to 500000 text characters and 20000 word tokens. Reports allow up to 10000 matches or repeated phrase groups. JSON and CSV preserve the full report, with bounded exports up to 40 million characters and 500000 CSV records. Analysis runs locally with a 10-second timeout. Preview search and sort cover the first 200 rows; copy returns the summary. Download the full report for every row. Your text is not uploaded.

### Inputs and settings

Text input: Your text.

Example or placeholder shown in the interface (not a validated fixture):

```text
Type or paste your input…
```

Up to 500,000 characters. Review the settings before running.

| Setting | Meaning | Control type | Default | Constraints |
| --- | --- | --- | --- | --- |
| `window` | Words per moving window | text | "50" | min=2 max=1000 step=1 |
| `caseMode` | Case comparison | select | "fold" | Allowed: fold, exact |

### Browser-agent workflow

1. Open the human page in a browser that supports WebMCP.
2. Discover the interface exposed by that page; use its actual schema.
3. Select files on the page first when the tool requires files.
4. Call `run_current_tool` with valid input and settings.
5. Inspect the returned result or error and the displayed output. Retrieve files from the displayed download links.

Calls do not automatically copy or download results. Browser permissions still apply. Interface availability alone is not proof of successful execution.

### Planning specification

Word tokens are Intl.Segmenter word-like segments containing a Unicode letter; pure numbers are excluded. TTR = distinct words / words; root TTR = distinct words / square root of words; corrected TTR = distinct words / square root of twice the words. Moving-average TTR uses only complete selected-size windows. These length-sensitive descriptive ratios do not measure proficiency or writing quality. Use up to 500000 text characters and 20000 word tokens. Reports allow up to 10000 matches or repeated phrase groups. JSON and CSV preserve the full report, with bounded exports up to 40 million characters and 500000 CSV records. Analysis runs locally with a 10-second timeout. Preview search and sort cover the first 200 rows; copy returns the summary. Download the full report for every row. Your text is not uploaded.

This describes intended requirements. Use the implementation notes, interface schema and observed output to determine current support.

### Complete machine-readable capability record

```json
{
  "id": "lexical-diversity-analyzer",
  "category": "text-tools",
  "built": true,
  "requirements": "Word tokens are Intl.Segmenter word-like segments containing a Unicode letter; pure numbers are excluded. TTR = distinct words / words; root TTR = distinct words / square root of words; corrected TTR = distinct words / square root of twice the words. Moving-average TTR uses only complete selected-size windows. These length-sensitive descriptive ratios do not measure proficiency or writing quality. Use up to 500000 text characters and 20000 word tokens. Reports allow up to 10000 matches or repeated phrase groups. JSON and CSV preserve the full report, with bounded exports up to 40 million characters and 500000 CSV records. Analysis runs locally with a 10-second timeout. Preview search and sort cover the first 200 rows; copy returns the summary. Download the full report for every row. Your text is not uploaded.",
  "implementation": {
    "fields": [
      {
        "key": "window",
        "label": "Words per moving window",
        "value": "50",
        "type": "text",
        "inputMode": "numeric",
        "maxLength": 8,
        "min": 2,
        "max": 1000,
        "step": 1,
        "help": "2–1000"
      },
      {
        "key": "caseMode",
        "label": "Case comparison",
        "value": "fold",
        "type": "select",
        "values": [
          "fold",
          "exact"
        ],
        "labels": {
          "fold": "Locale-aware lowercase",
          "exact": "Case-sensitive"
        }
      }
    ],
    "presentation": "metrics",
    "inputMaxLength": 500000,
    "inputErrorCode": "TEXT_DIAGNOSTICS_INPUT",
    "note": "Word tokens are Intl.Segmenter word-like segments containing a Unicode letter; pure numbers are excluded. TTR = distinct words / words; root TTR = distinct words / square root of words; corrected TTR = distinct words / square root of twice the words. Moving-average TTR uses only complete selected-size windows. These length-sensitive descriptive ratios do not measure proficiency or writing quality. Use up to 500000 text characters and 20000 word tokens. Reports allow up to 10000 matches or repeated phrase groups. JSON and CSV preserve the full report, with bounded exports up to 40 million characters and 500000 CSV records. Analysis runs locally with a 10-second timeout. Preview search and sort cover the first 200 rows; copy returns the summary. Download the full report for every row. Your text is not uploaded.",
    "experience": {
      "automatic": false,
      "single": false,
      "inputMaxLength": 500000,
      "inputMode": "text",
      "label": "Your text",
      "placeholder": "Type or paste your input…",
      "help": "Up to 500,000 characters. Review the settings before running.",
      "action": null
    },
    "mode": "explicit",
    "interactive": false
  },
  "execution": "Browser interface",
  "api": null,
  "browser_agent": {
    "supported": true,
    "name": "run_current_tool",
    "discovery": "WebMCP on the human page in a supporting browser",
    "verification": "See audit/API-AUDIT.md; availability is not verification"
  }
}
```

## Page guide

Measure transparent vocabulary ratios and moving-window variation in your own passage.

How can we improve this tool?

Report a problem or share an idea.

Please leave out private information. Your message and the tool name go to our team via PostHog.

### How to use Lexical diversity analyzer

1. Paste your own passage as plain text.
2. Choose explicit matching or analysis settings.
3. Review the bounded table and download complete JSON or CSV.

## Useful next steps

- [Concordance reader](https://happytails.ai/en/text-tools/concordance-reader/) ([Markdown](https://happytails.ai/en/text-tools/concordance-reader.md))

- [Vocabulary coverage estimator](https://happytails.ai/en/text-tools/vocabulary-coverage-estimator/) ([Markdown](https://happytails.ai/en/text-tools/vocabulary-coverage-estimator.md))

- [Editorial style guide checker](https://happytails.ai/en/text-tools/editorial-style-guide-checker/) ([Markdown](https://happytails.ai/en/text-tools/editorial-style-guide-checker.md))

## Know exactly what is measured

Word tokens are Intl.Segmenter word-like segments containing a Unicode letter; pure numbers are excluded. TTR = distinct words / words; root TTR = distinct words / square root of words; corrected TTR = distinct words / square root of twice the words. Moving-average TTR uses only complete selected-size windows. These length-sensitive descriptive ratios do not measure proficiency or writing quality.

### Keep the full report

Use up to 500000 text characters and 20000 word tokens. Reports allow up to 10000 matches or repeated phrase groups. JSON and CSV preserve the full report, with bounded exports up to 40 million characters and 500000 CSV records. Analysis runs locally with a 10-second timeout. Preview search and sort cover the first 200 rows; copy returns the summary. Download the full report for every row. Your text is not uploaded. Offsets refer to the original UTF-16 text. Machine report keys and your content are preserved. Formula-protected CSV changes risky cell prefixes; import columns as text when preserving exact identifiers.
