register-variation-code-switching

Compares writing feature distributions across contexts to classify register as stable or context-dependent.

13|2|Updated Feb 10, 2026
One-click install
npx skills add https://github.com/aaddrick/written-voice-replication --skill register-variation-code-switching-aaddrick
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: register-variation-code-switching
Source: https://github.com/aaddrick/written-voice-replication/tree/main/.claude/skills/register-variation-code-switching
Command: npx skills add https://github.com/aaddrick/written-voice-replication --skill register-variation-code-switching-aaddrick

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, scipy, vaderSentiment.

What problem does it solve? When analyzing a person's writing style, a single global profile can be misleading if the writer shifts tone, vocabulary, or formality across different communities or contexts. This Skill measures how much a writing voice varies across context-defined sub-corpora and determines whether one global style profile suffices or conditional, context-specific rules are needed. ## Core Features & Use Cases - Cross-Context Distribution Comparison: Compares vocabulary, formality, sentence length, and sentiment distributions across sub-corpora using KS tests, Mann-Whitney U, Cohen's d, and Cliff's delta. - Register Classification: Classifies a writer as stable-register, mildly context-dependent, or strongly context-dependent based on effect-size thresholds across dimensions. - Conditional Style Rules: Generates per-context replication rules (formality targets, sentence length ranges, vocabulary targets) when significant variation is detected. - Use Case: Given a Reddit export spanning technical and casual subreddits, determine whether the user writes consistently everywhere or systematically shifts register, then produce rules like "in technical contexts, use longer sentences and lower contraction rates." ## Quick Start Analyze my writing corpus across its different contexts and tell me whether my register is stable or context-dependent, with conditional style rules if it varies.

Frequently Asked Questions about register-variation-code-switching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I measure writing style variation across different contexts?

Segment the corpus into context-defined sub-corpora, extract per-text feature distributions for vocabulary, formality, sentence length, and sentiment, then compare distributions pairwise using KS tests and effect sizes like Cohen's d and Cliff's delta. Comparing distributions rather than means is what reveals register variation.

What statistical tests compare text feature distributions across corpora?

The two-sample Kolmogorov-Smirnov test compares entire distribution shapes, while Mann-Whitney U tests location differences non-parametrically. Effect sizes such as Cohen's d and Cliff's delta separate meaningful variation from statistical noise, which matters because large corpora make trivial differences significant.

How much text is needed per context for register analysis?

Each context needs at least 300 words and ideally 5 or more texts. Contexts below 300 words are excluded from pairwise comparison, and contexts with fewer than 5 texts are flagged as low-sample with unreliable effect sizes.

When should I not use register variation analysis?

Skip it when the corpus comes from a single context, when fewer than two contexts have sufficient text, when the text is multilingual and the goal is detecting language-switching, or when the corpus has multiple authors. Single-context corpora should use stylometric fingerprinting instead.

What is the difference between stable and context-dependent register?

A stable register means no feature dimension shows large effect sizes across context pairs, so one global style profile applies everywhere. A context-dependent register means multiple dimensions vary systematically, requiring conditional rules such as different formality and sentence-length targets per context.