Skip to content

Analyze content for rule suggestions

POST
/api/writing/proseguard/analyze

Analyze content to detect POV mode, character names, repetition candidates, and name form variants. Returns suggestions the user can accept or dismiss to populate ProseGuard rules.

AnalyzeRequest

Request body for POST /proseguard/analyze.

object
content
required
Content

Plain text content to analyze

string
projectId
required
Projectid

Project UUID

string
documentId
Any of:
string

Successful Response

ProseGuardAnalysis

Result of analyzing content for rule suggestions.

Generated by POST /proseguard/analyze. Contains suggestions that the user can accept or dismiss to populate ProseGuard rules.

object
pov
Any of:
PovSuggestion

Suggested POV mode based on pronoun analysis of narration text.

object
suggestedMode
required
Suggestedmode

Detected dominant POV mode

string
Allowed values: first second third_limited third_omniscient
confidence
required
Confidence

Confidence 0.0-1.0 (dominant count / total)

number
<= 1
pronounCounts
required
Pronouncounts

Pronoun counts by type — {“first”: 42, “second”: 3, “third”: 120}

object
key
additional properties
integer
characters
Characters

Detected character names, ideally grounded in Legendry

Array<object>
default:
CharacterSuggestion

A detected character name, ideally grounded in the Legendry.

When source == "legendry", the character was matched against an existing lore_entry (by title or alias) and legendry_title holds the canonical title. Pronouns are mined from the Legendry entry’s voice_profile, section content, or inferred as a last resort.

When source == "text_analysis", the name was detected in prose but has no matching Legendry entry — the user should consider adding one.

object
name
required
Name

Name as it appears in the prose

string
loreEntryId
Any of:
string
legendryTitle
Any of:
string
matchedVia
required
Matchedvia

How the name was resolved against the Legendry

string
Allowed values: title alias text_analysis
suggestedPronouns
required
Suggestedpronouns

Suggested pronoun set (e.g., [‘he’, ‘him’])

Array<string>
pronounSource
required
Pronounsource

Where the pronouns came from in the Legendry

string
Allowed values: sections voice_profile content_scan inferred none
voiceRegister
Any of:
string
occurrenceCount
required
Occurrencecount

Times this name appears in text

integer
>= 1
source
required
Source

Whether suggestion is grounded in Legendry or pure text detection

string
Allowed values: text_analysis legendry
entities
Entities

Non-character Legendry entities referenced in prose

Array<object>
default:
EntityMentionSuggestion

A non-character Legendry entity (faction, location, species, event, etc.) detected in the prose.

These feed continuity.required_name_forms: the canonical title becomes the required form, and any variant spellings found in prose that don’t match either the title or a registered alias become variant entries.

object
nameInText
required
Nameintext

The form that appeared in prose

string
loreEntryId
required
Loreentryid

Legendry entry ID

string
legendryTitle
required
Legendrytitle

Canonical Legendry title

string
entryType
required
Entrytype

Legendry entry_type (faction, location, species, event, etc.)

string
aliases
required
Aliases

Aliases already registered on the Legendry entry

Array<string>
occurrenceCount
required
Occurrencecount

Times the entity appears in prose

integer
>= 1
matchedVia
required
Matchedvia

How the entity was resolved against the Legendry

string
Allowed values: title alias
legendryDuplicates
Legendryduplicates

Legendry entries that look like the same entity

Array<object>
default:
LegendryDuplicate

Two Legendry entries that look like the same entity.

Not a name-form suggestion — ProseGuard cannot reconcile the rules on its own. The user needs to merge or delete one of the entries.

object
entryAId
required
Entryaid

First entry ID

string
entryATitle
required
Entryatitle

First entry title

string
entryBId
required
Entrybid

Second entry ID

string
entryBTitle
required
Entrybtitle

Second entry title

string
entryType
required
Entrytype

Entry type (both entries share this)

string
similarityReason
required
Similarityreason

Why they look alike (e.g. ‘titles differ by 1 character’)

string
repetitionCandidates
Repetitioncandidates

Words that may be crutch words based on frequency

Array<object>
default:
RepetitionSuggestion

A frequently repeated word that could be a crutch word candidate.

object
word
required
Word

The repeated word

string
totalCount
required
Totalcount

Total occurrences in document

integer
>= 1
paragraphSpread
required
Paragraphspread

Number of distinct paragraphs the word appears in

integer
>= 1
nameFormCandidates
Nameformcandidates

Name variant pairs that may need canonical form enforcement

Array<object>
default:
NameFormSuggestion

A pair of name variants where one may be the canonical form.

object
variant
required
Variant

Less frequent variant (e.g., ‘Alexander’)

string
canonical
required
Canonical

More frequent form (e.g., ‘Alex’)

string
variantCount
required
Variantcount

Occurrences of the variant

integer
>= 1
canonicalCount
required
Canonicalcount

Occurrences of the canonical form

integer
>= 1
wordCount
required
Wordcount

Word count of analyzed content

integer

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object