Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions ai_artifacts/project_understanding.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pycaption/
│ ├── srt.py # SRT format (reader + writer in single file)
│ ├── microdvd.py # MicroDVD format (reader + writer)
│ └── transcript.py # Plain text transcript (writer only, uses nltk)
├── tests/ # Test suite (504 tests)
├── tests/ # Test suite (505 tests)
│ ├── conftest.py # Fixture imports (re-exports from fixtures/)
│ ├── fixtures/ # Pytest fixture modules (inline caption strings)
│ │ ├── scc.py, translated_scc.py, dfxp.py, webvtt.py, srt.py, sami.py, microdvd.py
Expand Down Expand Up @@ -217,6 +217,10 @@ The SAMI reader uses a two-phase approach:
overflow (not 100% as might be expected)
6. **Style filtering**: Writers filter internal keys (e.g. `classes`, `webvtt_positioning`) from
output via format-specific exclusion sets
7. **RP 2052-10 implicit defaults**: When source format's visual default differs from
target format's default, writers explicitly emit the source's alignment. VTT/SRT/SCC
default to center; DFXP/SAMI default to left/start. The `is_positional_anchor` flag
on Layout distinguishes SCC coordinate-system positioning from visual alignment intent.

---

Expand Down Expand Up @@ -286,7 +290,7 @@ Additional workflows for format spec compliance:
### Running Tests Locally

```bash
# Run all tests (504 tests, ~0.5s)
# Run all tests (505 tests, ~0.5s)
python -m pytest tests/ -q

# Run specific format tests
Expand All @@ -299,7 +303,7 @@ python -m pytest tests/ -v
python -m pytest tests/test_webvtt_conversion.py -q
```

- Tests cover all formats (504 tests total)
- Tests cover all formats (505 tests total)
- Fixtures defined in `tests/fixtures/` as pytest session-scoped fixtures
- Each fixture is an inline string containing a complete caption file
- Conversion tests verify round-trip and cross-format fidelity
Expand Down
41 changes: 32 additions & 9 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,38 @@ Changelog
---------
2.3.2
^^^^^^
- DFXP writer: output ``textAlign="center"`` (not ``"start"``) as the
fallback alignment for cues that carry no explicit alignment.
Separates the writer's fallback (CENTER) from the reader's default
region (START) via a new ``DFXP_WRITER_FALLBACK_ALIGNMENT`` constant.

- SAMI reader: apply the SAMI spec default ``text-align: left`` only at
the root layout level (no parent to inherit from). Child layouts
without an explicit text-align now correctly inherit from their parent
stylesheet rather than being forced to left.
- RP 2052-10 compliance for all 25 conversion paths: when source format's
visual default is CENTER (VTT/SRT/SCC) and target default is LEFT/START
(DFXP/SAMI), explicitly emit center alignment. DFXP/SAMI sources retain
their original alignment for round-trip fidelity.

- DFXP writer: suppress ``tts:origin`` from SCC positional layouts
(row/column anchors), emit ``tts:textAlign="center"`` instead.

- WebVTT writer: suppress SCC positional cue settings (``align:left
position:N% line:N% size:N%``). SCC coordinate anchors are not visual
alignment — omitting lets VTT default to center.

- SAMI reader: apply ``text-align: left`` only at the root layout level;
child layouts now inherit from parent rather than being forced to left.

- SAMI writer: emit semantic tags (``<i>``, ``<b>``, ``<u>``) instead of
``<span style="...">``. Add trailing ``&nbsp;`` sync to clear the final
caption at its end time.

- Geometry: add ``is_positional_anchor`` flag to ``Layout`` to distinguish
SCC coordinate-system positioning from visual text alignment.

- Alignment preservation now uses an explicit ``visual_alignment_default``
attribute on ``CaptionSet`` (set by each reader) rather than inferring
intent from missing layout objects. Writers compare source vs target
defaults via ``BaseWriter._get_visual_alignment_default()``.

- Codebase-wide readability pass: dict lookups replace if/elif chains,
``@total_ordering`` on ``Size``, ``__eq__`` returns ``NotImplemented``,
writer signatures unified to ``**kwargs``, dead code removed
(``NodeCreatorFactory``, ``Caption.is_empty``, ``Layout.__ne__``).
Net −105 lines across 17 files, no behavioral changes.

2.3.1
^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
# built documents.
#
# The short X.Y version.
version = "2.3.1"
version = "2.3.2.dev1"
# The full version, including alpha/beta/rc tags.
release = "2.3.1"
release = "2.3.2.dev1"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
Loading
Loading