Module: JLPT::Syntax
- Defined in:
- lib/jlpt/analyzers/syntax.rb
Overview
Syntax and Sentence Clause Complexity Analyzer.
Identifies conjunction particles and subordinate clause connectives (が, けど, から, ので, とき, たら, ば, なら, のに, けれども), calculating clause density and syntactic complexity indices.
Constant Summary collapse
- CONJUNCTION_PATTERNS =
/(?:けれども|けれど|けど|ので|から|とき|たら|なら|のに|が|し)\b/.freeze
Class Method Summary collapse
-
.analyze(text) ⇒ Hash
Analyze syntactic clause complexity of Japanese text.
Class Method Details
.analyze(text) ⇒ Hash
Analyze syntactic clause complexity of Japanese text
18 19 20 21 22 23 |
# File 'lib/jlpt/analyzers/syntax.rb', line 18 def analyze(text) cleaned = Preprocessor.clean(text) return empty_analysis if cleaned.empty? compute_syntax_metrics(cleaned) end |