Skip to content

Conversation

@lenzo-ka
Copy link
Contributor

Description

Improve documentation for alignment output format and options, making them discoverable via CLI help and library documentation.

CLI changes:

  • Add "Output format" section to general help documenting JSON fields (b, d, p, t, w)
  • Document when each alignment level is produced (words by default, phones with -phone_align, states with -state_align)

C API changes:

  • Document ps_alignment_t with hierarchy explanation (words → phones → states)
  • Document iteration methods (flat and hierarchical)
  • Document entry fields (name, start, duration, score) with frame-to-seconds conversion
  • Clarify that score is acoustic log probability where higher is better

Python API changes:

  • Improve Alignment class docstring explaining three levels and two iteration methods
  • Improve AlignmentEntry docstring with clearer attribute documentation and example showing seconds conversion

Addresses #453
Addresses #370

Verification steps

  1. Run pocketsphinx help and verify output format is documented
  2. Run pocketsphinx help align and verify alignment levels are explained
  3. Build and run test_word_align to confirm no regressions

Add output format section to general help describing JSON fields
(b, d, p, t, w). Add documentation to align help explaining when
each level (words, phones, states) is produced based on options.
Add documentation to ps_alignment_t explaining the three-level
hierarchy (words, phones, states), iteration methods, and entry
fields. Clarify that score is acoustic log probability where
higher (less negative) is better.

Addresses: cmusphinx#370
Improve Alignment class docstring to explain three-level hierarchy
and two iteration methods (flat and hierarchical). Improve
AlignmentEntry docstring with clearer attribute documentation,
frame-to-seconds conversion notes, and example showing output
in seconds.
@lenzo-ka lenzo-ka requested a review from dhdaines January 14, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant