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
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

- macOS 26 或更高版本
- Xcode 26 或更高版本
- Python 3.14 (使用 Xcode 安裝後內附的就可以,也可使用 homebrew 等方式安裝)
- Python 3.9 (使用 Xcode 安裝後內附的就可以,也可使用 homebrew 等方式安裝)

## 開發流程

Expand Down
7 changes: 4 additions & 3 deletions Source/Data/curation/mandarin/grid.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import math
from dataclasses import dataclass
from typing import Optional, Union


@dataclass
Expand All @@ -12,7 +13,7 @@ class Node:
@dataclass
class State:
from_column: int = 0
from_node: Node | None = None
from_node: Optional[Node] = None
max_score: float = -math.inf


Expand All @@ -21,14 +22,14 @@ class State:

def most_plausible_walk(
readings: list[str],
langmodel: dict[str, list[tuple[str, str | float]]],
langmodel: dict[str, list[tuple[str, Union[str, float]]]],
separator: str = "-",
) -> list[Node]:

rlen = len(readings)

# Build a grid of rlen columns, each column having MAX_SPAN_LEN spans.
grid: list[list[Node | None]] = [
grid: list[list[Optional[Node]]] = [
[None for _ in range(MAX_SPAN_LEN)] for _ in range(rlen)
]

Expand Down
Loading