wordorientation - Detect Attraction and Repulsion Between Words in Text
Provides tools to quantify how strongly pairs of words
attract or repel each other in a text corpus, based on
co-occurrence patterns. For each word pair, the phi coefficient
(a correlation measure for binary variables) is computed from a
document-term matrix and tested for significance, then
classified as showing attraction (co-occurring more than chance
would predict), repulsion (co-occurring less than chance would
predict), or no significant relationship. A full pipeline is
provided from raw text to a labeled network visualization.
Unlike general-purpose pairwise correlation tools,
'wordorientation' is built specifically for text: it handles
tokenization and stopword removal, applies significance-based
classification rather than reporting a raw correlation
coefficient alone, and produces a ready-to-plot attraction/
repulsion network. Methods for word co-occurrence and the phi
coefficient follow Evert (2008) <doi:10.1075/z.143.13eve> and
standard corpus linguistics practice for collocation and
association measures.