Spaces:
Sleeping
Sleeping
Fast deploy (index 406ebfb412f4)
Browse files- Dockerfile +1 -1
- backend/app.py +2 -0
- backend/atlas.py +121 -23
- backend/mmap_store.py +46 -1
- frontend/dist/assets/index-Cp4-piqH.js +0 -0
- frontend/dist/assets/index-Cqu1pV49.css +1 -0
- frontend/dist/index.html +2 -2
Dockerfile
CHANGED
|
@@ -27,7 +27,7 @@ COPY frontend/dist ./frontend/dist
|
|
| 27 |
|
| 28 |
# Pinned prebuilt index artifact (update when republishing the dataset).
|
| 29 |
ARG INDEX_URL=https://huggingface.co/datasets/Mongoosetross/reverse-etymology-index/resolve/main/index.tar.zst
|
| 30 |
-
ARG INDEX_SHA256=
|
| 31 |
RUN mkdir -p data/index \
|
| 32 |
&& curl -fsSL "$INDEX_URL" -o /tmp/index.tar.zst \
|
| 33 |
&& if [ -n "$INDEX_SHA256" ]; then echo "$INDEX_SHA256 /tmp/index.tar.zst" | sha256sum -c -; fi \
|
|
|
|
| 27 |
|
| 28 |
# Pinned prebuilt index artifact (update when republishing the dataset).
|
| 29 |
ARG INDEX_URL=https://huggingface.co/datasets/Mongoosetross/reverse-etymology-index/resolve/main/index.tar.zst
|
| 30 |
+
ARG INDEX_SHA256=406ebfb412f4b65e0d6e0152aa537f9ddc16dead92faff73dddb61dcf4cdd540
|
| 31 |
RUN mkdir -p data/index \
|
| 32 |
&& curl -fsSL "$INDEX_URL" -o /tmp/index.tar.zst \
|
| 33 |
&& if [ -n "$INDEX_SHA256" ]; then echo "$INDEX_SHA256 /tmp/index.tar.zst" | sha256sum -c -; fi \
|
backend/app.py
CHANGED
|
@@ -40,6 +40,7 @@ def health() -> dict:
|
|
| 40 |
"loaded": atlas.loaded,
|
| 41 |
"nodes": atlas.n,
|
| 42 |
"edges": atlas.meta.get("edges"),
|
|
|
|
| 43 |
"load_ms": getattr(atlas, "load_ms", None),
|
| 44 |
"citation": atlas.meta.get("citation"),
|
| 45 |
}
|
|
@@ -61,6 +62,7 @@ def meta() -> dict:
|
|
| 61 |
"citation": m.get("citation"),
|
| 62 |
"nodes": m.get("nodes"),
|
| 63 |
"edges": m.get("edges"),
|
|
|
|
| 64 |
}
|
| 65 |
|
| 66 |
|
|
|
|
| 40 |
"loaded": atlas.loaded,
|
| 41 |
"nodes": atlas.n,
|
| 42 |
"edges": atlas.meta.get("edges"),
|
| 43 |
+
"hyperedges": atlas.meta.get("hyperedges"),
|
| 44 |
"load_ms": getattr(atlas, "load_ms", None),
|
| 45 |
"citation": atlas.meta.get("citation"),
|
| 46 |
}
|
|
|
|
| 62 |
"citation": m.get("citation"),
|
| 63 |
"nodes": m.get("nodes"),
|
| 64 |
"edges": m.get("edges"),
|
| 65 |
+
"hyperedges": m.get("hyperedges"),
|
| 66 |
}
|
| 67 |
|
| 68 |
|
backend/atlas.py
CHANGED
|
@@ -11,6 +11,7 @@ from pathlib import Path
|
|
| 11 |
import numpy as np
|
| 12 |
|
| 13 |
from backend.constants import DEFAULT_RELATIONS, REL_TO_CODE, RELATIONS
|
|
|
|
| 14 |
from backend.filters import FilterContext, node_ok, path_filter_empty, path_ok, predicate_empty
|
| 15 |
from backend.mmap_store import load_graph, mmap_dir
|
| 16 |
from backend.models import EdgeFilter, TreeQuery
|
|
@@ -49,6 +50,16 @@ class Atlas:
|
|
| 49 |
self.child_count: np.ndarray | None = None
|
| 50 |
self.lang_meta: dict[str, dict] = {}
|
| 51 |
self._arrays: dict[str, np.ndarray] = {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
def load(self) -> None:
|
| 54 |
sqlite_path = self.index_dir / "atlas.sqlite"
|
|
@@ -65,6 +76,16 @@ class Atlas:
|
|
| 65 |
self.forward = CSR(arrays["fwd_off"], arrays["fwd_tgt"], arrays["fwd_rel"], arrays["fwd_conf"], arrays["fwd_src"])
|
| 66 |
self.n = int(len(self.reverse.offsets) - 1)
|
| 67 |
self.child_count = arrays["child_count"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
self.conn = sqlite3.connect(f"file:{sqlite_path}?mode=ro", uri=True, check_same_thread=False)
|
| 70 |
self.conn.row_factory = sqlite3.Row
|
|
@@ -269,6 +290,9 @@ class Atlas:
|
|
| 269 |
child_rels: dict[str, int] = defaultdict(int)
|
| 270 |
for e in rev.edge_range(nid):
|
| 271 |
child_rels[RELATIONS[int(rev.rel[e])]] += 1
|
|
|
|
|
|
|
|
|
|
| 272 |
etymon_ids = [int(fwd.targets[e]) for e in list(fwd.edge_range(nid))[:40]]
|
| 273 |
extra = self.hydrate(etymon_ids)
|
| 274 |
etymons = []
|
|
@@ -287,6 +311,49 @@ class Atlas:
|
|
| 287 |
}
|
| 288 |
)
|
| 289 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 290 |
cognates = []
|
| 291 |
for row in self.conn.execute(
|
| 292 |
"""
|
|
@@ -335,6 +402,7 @@ class Atlas:
|
|
| 335 |
**node,
|
| 336 |
"child_relations": dict(child_rels),
|
| 337 |
"etymons": etymons,
|
|
|
|
| 338 |
"cognate_sets": cognates,
|
| 339 |
"wals": wals[:80],
|
| 340 |
"phonemes": phoneme_list,
|
|
@@ -381,13 +449,34 @@ def walk_tree(atlas: Atlas, query: TreeQuery, root: int, t0: float) -> dict:
|
|
| 381 |
max_visit = query.edges.max_visit
|
| 382 |
|
| 383 |
parent: dict[int, int] = {root: -1}
|
| 384 |
-
parent_edge: dict[int, int] = {root: -1}
|
|
|
|
|
|
|
|
|
|
| 385 |
depth_of: dict[int, int] = {root: 0}
|
| 386 |
|
| 387 |
q: deque[int] = deque([root])
|
| 388 |
visited = 1
|
| 389 |
truncated = False
|
| 390 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 391 |
while q:
|
| 392 |
node = q.popleft()
|
| 393 |
d = depth_of[node]
|
|
@@ -395,23 +484,36 @@ def walk_tree(atlas: Atlas, query: TreeQuery, root: int, t0: float) -> dict:
|
|
| 395 |
continue
|
| 396 |
start = int(rev.offsets[node])
|
| 397 |
end = int(rev.offsets[node + 1])
|
|
|
|
| 398 |
for e in range(start, end):
|
| 399 |
if rel_mask[int(rev.rel[e])] == 0:
|
| 400 |
continue
|
| 401 |
if int(rev.conf[e]) < min_conf:
|
| 402 |
continue
|
| 403 |
child = int(rev.targets[e])
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 413 |
break
|
| 414 |
-
q.append(child)
|
| 415 |
|
| 416 |
has_child: set[int] = set()
|
| 417 |
for nid, p in parent.items():
|
|
@@ -454,9 +556,9 @@ def walk_tree(atlas: Atlas, query: TreeQuery, root: int, t0: float) -> dict:
|
|
| 454 |
cur = nid
|
| 455 |
while cur != -1:
|
| 456 |
path_nodes.append(cur)
|
| 457 |
-
|
| 458 |
-
if
|
| 459 |
-
path_rels.append(int(
|
| 460 |
cur = parent.get(cur, -1)
|
| 461 |
path_nodes.reverse()
|
| 462 |
path_rels.reverse()
|
|
@@ -490,19 +592,15 @@ def walk_tree(atlas: Atlas, query: TreeQuery, root: int, t0: float) -> dict:
|
|
| 490 |
payload_nodes: list[dict] = []
|
| 491 |
|
| 492 |
def relation_of(child: int) -> str:
|
| 493 |
-
|
| 494 |
-
if
|
| 495 |
return ""
|
| 496 |
-
return RELATIONS[int(
|
| 497 |
|
| 498 |
def conf_of(child: int) -> float:
|
| 499 |
-
|
| 500 |
-
if e < 0:
|
| 501 |
-
return 1.0
|
| 502 |
-
return int(rev.conf[e]) / 100.0
|
| 503 |
|
| 504 |
def add_word(nid: int) -> None:
|
| 505 |
-
e = parent_edge.get(nid, -1)
|
| 506 |
payload_nodes.append(
|
| 507 |
{
|
| 508 |
"id": nid,
|
|
@@ -513,7 +611,7 @@ def walk_tree(atlas: Atlas, query: TreeQuery, root: int, t0: float) -> dict:
|
|
| 513 |
"depth": int(depth_of[nid]),
|
| 514 |
"relation": relation_of(nid) if nid != root else None,
|
| 515 |
"confidence": conf_of(nid) if nid != root else None,
|
| 516 |
-
"source":
|
| 517 |
"child_count": int(atlas.child_count[nid]),
|
| 518 |
"visible_children": len(children.get(nid, [])),
|
| 519 |
}
|
|
|
|
| 11 |
import numpy as np
|
| 12 |
|
| 13 |
from backend.constants import DEFAULT_RELATIONS, REL_TO_CODE, RELATIONS
|
| 14 |
+
from pipeline.kaikki_etymology import HYPER_TEMPLATE_VOCAB
|
| 15 |
from backend.filters import FilterContext, node_ok, path_filter_empty, path_ok, predicate_empty
|
| 16 |
from backend.mmap_store import load_graph, mmap_dir
|
| 17 |
from backend.models import EdgeFilter, TreeQuery
|
|
|
|
| 50 |
self.child_count: np.ndarray | None = None
|
| 51 |
self.lang_meta: dict[str, dict] = {}
|
| 52 |
self._arrays: dict[str, np.ndarray] = {}
|
| 53 |
+
self.hyper_parent: np.ndarray | None = None
|
| 54 |
+
self.hyper_rel: np.ndarray | None = None
|
| 55 |
+
self.hyper_conf: np.ndarray | None = None
|
| 56 |
+
self.hyper_tmpl: np.ndarray | None = None
|
| 57 |
+
self.hyper_part_off: np.ndarray | None = None
|
| 58 |
+
self.hyper_part_tgt: np.ndarray | None = None
|
| 59 |
+
self.inc_off: np.ndarray | None = None
|
| 60 |
+
self.inc_hyper: np.ndarray | None = None
|
| 61 |
+
self.par_off: np.ndarray | None = None
|
| 62 |
+
self.par_hyper: np.ndarray | None = None
|
| 63 |
|
| 64 |
def load(self) -> None:
|
| 65 |
sqlite_path = self.index_dir / "atlas.sqlite"
|
|
|
|
| 76 |
self.forward = CSR(arrays["fwd_off"], arrays["fwd_tgt"], arrays["fwd_rel"], arrays["fwd_conf"], arrays["fwd_src"])
|
| 77 |
self.n = int(len(self.reverse.offsets) - 1)
|
| 78 |
self.child_count = arrays["child_count"]
|
| 79 |
+
self.hyper_parent = arrays.get("hyper_parent")
|
| 80 |
+
self.hyper_rel = arrays.get("hyper_rel")
|
| 81 |
+
self.hyper_conf = arrays.get("hyper_conf")
|
| 82 |
+
self.hyper_tmpl = arrays.get("hyper_tmpl")
|
| 83 |
+
self.hyper_part_off = arrays.get("hyper_part_off")
|
| 84 |
+
self.hyper_part_tgt = arrays.get("hyper_part_tgt")
|
| 85 |
+
self.inc_off = arrays.get("inc_off")
|
| 86 |
+
self.inc_hyper = arrays.get("inc_hyper")
|
| 87 |
+
self.par_off = arrays.get("par_off")
|
| 88 |
+
self.par_hyper = arrays.get("par_hyper")
|
| 89 |
|
| 90 |
self.conn = sqlite3.connect(f"file:{sqlite_path}?mode=ro", uri=True, check_same_thread=False)
|
| 91 |
self.conn.row_factory = sqlite3.Row
|
|
|
|
| 290 |
child_rels: dict[str, int] = defaultdict(int)
|
| 291 |
for e in rev.edge_range(nid):
|
| 292 |
child_rels[RELATIONS[int(rev.rel[e])]] += 1
|
| 293 |
+
if self.inc_off is not None and self.inc_hyper is not None and self.hyper_rel is not None:
|
| 294 |
+
for h in self.inc_hyper[int(self.inc_off[nid]) : int(self.inc_off[nid + 1])]:
|
| 295 |
+
child_rels[RELATIONS[int(self.hyper_rel[int(h)])]] += 1
|
| 296 |
etymon_ids = [int(fwd.targets[e]) for e in list(fwd.edge_range(nid))[:40]]
|
| 297 |
extra = self.hydrate(etymon_ids)
|
| 298 |
etymons = []
|
|
|
|
| 311 |
}
|
| 312 |
)
|
| 313 |
|
| 314 |
+
formations = []
|
| 315 |
+
if (
|
| 316 |
+
self.par_off is not None
|
| 317 |
+
and self.par_hyper is not None
|
| 318 |
+
and self.hyper_parent is not None
|
| 319 |
+
and self.hyper_part_off is not None
|
| 320 |
+
and self.hyper_part_tgt is not None
|
| 321 |
+
):
|
| 322 |
+
part_ids: list[int] = []
|
| 323 |
+
hyper_ids = [int(h) for h in self.par_hyper[int(self.par_off[nid]) : int(self.par_off[nid + 1])]]
|
| 324 |
+
for h in hyper_ids:
|
| 325 |
+
a = int(self.hyper_part_off[h])
|
| 326 |
+
b = int(self.hyper_part_off[h + 1])
|
| 327 |
+
part_ids.extend(int(x) for x in self.hyper_part_tgt[a:b])
|
| 328 |
+
part_info = self.hydrate(part_ids) if part_ids else {}
|
| 329 |
+
for h in hyper_ids[:24]:
|
| 330 |
+
a = int(self.hyper_part_off[h])
|
| 331 |
+
b = int(self.hyper_part_off[h + 1])
|
| 332 |
+
tmpl_code = int(self.hyper_tmpl[h]) if self.hyper_tmpl is not None else 0
|
| 333 |
+
tmpl = HYPER_TEMPLATE_VOCAB[tmpl_code] if tmpl_code < len(HYPER_TEMPLATE_VOCAB) else "compound"
|
| 334 |
+
parts = []
|
| 335 |
+
for pi, pid in enumerate(self.hyper_part_tgt[a:b]):
|
| 336 |
+
info = part_info.get(int(pid), {})
|
| 337 |
+
parts.append(
|
| 338 |
+
{
|
| 339 |
+
"id": int(pid),
|
| 340 |
+
"term": info.get("term", ""),
|
| 341 |
+
"lang": info.get("lang", ""),
|
| 342 |
+
"lang_display": info.get("lang_display"),
|
| 343 |
+
"family_name": info.get("family_name"),
|
| 344 |
+
"part_index": pi,
|
| 345 |
+
}
|
| 346 |
+
)
|
| 347 |
+
formations.append(
|
| 348 |
+
{
|
| 349 |
+
"id": h,
|
| 350 |
+
"template": tmpl,
|
| 351 |
+
"relation": RELATIONS[int(self.hyper_rel[h])] if self.hyper_rel is not None else "compound",
|
| 352 |
+
"confidence": (int(self.hyper_conf[h]) / 100.0) if self.hyper_conf is not None else 0.9,
|
| 353 |
+
"parts": parts,
|
| 354 |
+
}
|
| 355 |
+
)
|
| 356 |
+
|
| 357 |
cognates = []
|
| 358 |
for row in self.conn.execute(
|
| 359 |
"""
|
|
|
|
| 402 |
**node,
|
| 403 |
"child_relations": dict(child_rels),
|
| 404 |
"etymons": etymons,
|
| 405 |
+
"formations": formations,
|
| 406 |
"cognate_sets": cognates,
|
| 407 |
"wals": wals[:80],
|
| 408 |
"phonemes": phoneme_list,
|
|
|
|
| 449 |
max_visit = query.edges.max_visit
|
| 450 |
|
| 451 |
parent: dict[int, int] = {root: -1}
|
| 452 |
+
parent_edge: dict[int, int] = {root: -1} # binary edge index, or -1
|
| 453 |
+
parent_hyper: dict[int, int] = {root: -1} # hyperedge id, or -1
|
| 454 |
+
parent_rel_code: dict[int, int] = {root: -1}
|
| 455 |
+
parent_conf_code: dict[int, int] = {root: 100}
|
| 456 |
depth_of: dict[int, int] = {root: 0}
|
| 457 |
|
| 458 |
q: deque[int] = deque([root])
|
| 459 |
visited = 1
|
| 460 |
truncated = False
|
| 461 |
|
| 462 |
+
def consider(child: int, via_parent: int, rel_code: int, conf_code: int, bin_e: int, hyp_h: int) -> bool:
|
| 463 |
+
nonlocal visited, truncated
|
| 464 |
+
if child in depth_of:
|
| 465 |
+
return False
|
| 466 |
+
depth_of[child] = depth_of[via_parent] + 1
|
| 467 |
+
parent[child] = via_parent
|
| 468 |
+
parent_edge[child] = bin_e
|
| 469 |
+
parent_hyper[child] = hyp_h
|
| 470 |
+
parent_rel_code[child] = rel_code
|
| 471 |
+
parent_conf_code[child] = conf_code
|
| 472 |
+
visited += 1
|
| 473 |
+
if visited >= max_visit:
|
| 474 |
+
truncated = True
|
| 475 |
+
q.clear()
|
| 476 |
+
return True
|
| 477 |
+
q.append(child)
|
| 478 |
+
return False
|
| 479 |
+
|
| 480 |
while q:
|
| 481 |
node = q.popleft()
|
| 482 |
d = depth_of[node]
|
|
|
|
| 484 |
continue
|
| 485 |
start = int(rev.offsets[node])
|
| 486 |
end = int(rev.offsets[node + 1])
|
| 487 |
+
stop = False
|
| 488 |
for e in range(start, end):
|
| 489 |
if rel_mask[int(rev.rel[e])] == 0:
|
| 490 |
continue
|
| 491 |
if int(rev.conf[e]) < min_conf:
|
| 492 |
continue
|
| 493 |
child = int(rev.targets[e])
|
| 494 |
+
stop = consider(child, node, int(rev.rel[e]), int(rev.conf[e]), e, -1)
|
| 495 |
+
if stop:
|
| 496 |
+
break
|
| 497 |
+
if stop:
|
| 498 |
+
break
|
| 499 |
+
# Hypergraph: formations that use this node as a part → derived parent word.
|
| 500 |
+
if getattr(atlas, "inc_off", None) is not None and getattr(atlas, "inc_hyper", None) is not None and getattr(atlas, "hyper_parent", None) is not None:
|
| 501 |
+
ia = int(atlas.inc_off[node])
|
| 502 |
+
ib = int(atlas.inc_off[node + 1])
|
| 503 |
+
for h in atlas.inc_hyper[ia:ib]:
|
| 504 |
+
h = int(h)
|
| 505 |
+
rel_c = int(atlas.hyper_rel[h]) if atlas.hyper_rel is not None else REL_TO_CODE["compound"]
|
| 506 |
+
if rel_mask[rel_c] == 0:
|
| 507 |
+
continue
|
| 508 |
+
conf_c = int(atlas.hyper_conf[h]) if atlas.hyper_conf is not None else 90
|
| 509 |
+
if conf_c < min_conf:
|
| 510 |
+
continue
|
| 511 |
+
child = int(atlas.hyper_parent[h])
|
| 512 |
+
stop = consider(child, node, rel_c, conf_c, -1, h)
|
| 513 |
+
if stop:
|
| 514 |
+
break
|
| 515 |
+
if stop:
|
| 516 |
break
|
|
|
|
| 517 |
|
| 518 |
has_child: set[int] = set()
|
| 519 |
for nid, p in parent.items():
|
|
|
|
| 556 |
cur = nid
|
| 557 |
while cur != -1:
|
| 558 |
path_nodes.append(cur)
|
| 559 |
+
rc = parent_rel_code.get(cur, -1)
|
| 560 |
+
if rc >= 0:
|
| 561 |
+
path_rels.append(int(rc))
|
| 562 |
cur = parent.get(cur, -1)
|
| 563 |
path_nodes.reverse()
|
| 564 |
path_rels.reverse()
|
|
|
|
| 592 |
payload_nodes: list[dict] = []
|
| 593 |
|
| 594 |
def relation_of(child: int) -> str:
|
| 595 |
+
rc = parent_rel_code.get(child, -1)
|
| 596 |
+
if rc < 0:
|
| 597 |
return ""
|
| 598 |
+
return RELATIONS[int(rc)]
|
| 599 |
|
| 600 |
def conf_of(child: int) -> float:
|
| 601 |
+
return int(parent_conf_code.get(child, 100)) / 100.0
|
|
|
|
|
|
|
|
|
|
| 602 |
|
| 603 |
def add_word(nid: int) -> None:
|
|
|
|
| 604 |
payload_nodes.append(
|
| 605 |
{
|
| 606 |
"id": nid,
|
|
|
|
| 611 |
"depth": int(depth_of[nid]),
|
| 612 |
"relation": relation_of(nid) if nid != root else None,
|
| 613 |
"confidence": conf_of(nid) if nid != root else None,
|
| 614 |
+
"source": 0,
|
| 615 |
"child_count": int(atlas.child_count[nid]),
|
| 616 |
"visible_children": len(children.get(nid, [])),
|
| 617 |
}
|
backend/mmap_store.py
CHANGED
|
@@ -17,6 +17,19 @@ MMAP_FILES = {
|
|
| 17 |
"fwd_rel": ("fwd_rel.u8", np.uint8),
|
| 18 |
"fwd_conf": ("fwd_conf.u8", np.uint8),
|
| 19 |
"fwd_src": ("fwd_src.u8", np.uint8),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
"lang_code": ("lang_code.u16", np.uint16),
|
| 21 |
"child_count": ("child_count.u16", np.uint16),
|
| 22 |
"lang_family": ("lang_family.u16", np.uint16),
|
|
@@ -29,6 +42,20 @@ MMAP_FILES = {
|
|
| 29 |
"freq_rank": ("freq_rank.u32", np.uint32),
|
| 30 |
}
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
def mmap_dir(index_dir: Path) -> Path:
|
| 34 |
return Path(index_dir) / "mmap"
|
|
@@ -70,10 +97,28 @@ def load_graph(index_dir: Path, copy: bool = False) -> dict[str, np.ndarray]:
|
|
| 70 |
for key, (fname, dtype) in MMAP_FILES.items():
|
| 71 |
path = d / fname
|
| 72 |
if not path.exists():
|
| 73 |
-
# Backward compatible: older indexes without frequency arrays.
|
| 74 |
if key in ("freq_zipf", "freq_rank") and n_nodes is not None:
|
| 75 |
out[key] = np.zeros(n_nodes, dtype=dtype)
|
| 76 |
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
raise FileNotFoundError(path)
|
| 78 |
arr = open_array(path, dtype)
|
| 79 |
out[key] = np.array(arr) if copy else arr
|
|
|
|
| 17 |
"fwd_rel": ("fwd_rel.u8", np.uint8),
|
| 18 |
"fwd_conf": ("fwd_conf.u8", np.uint8),
|
| 19 |
"fwd_src": ("fwd_src.u8", np.uint8),
|
| 20 |
+
# N-ary compound/blend hyperedges (parent + ordered parts).
|
| 21 |
+
"hyper_parent": ("hyper_parent.i32", np.int32),
|
| 22 |
+
"hyper_rel": ("hyper_rel.u8", np.uint8),
|
| 23 |
+
"hyper_conf": ("hyper_conf.u8", np.uint8),
|
| 24 |
+
"hyper_tmpl": ("hyper_tmpl.u8", np.uint8),
|
| 25 |
+
"hyper_part_off": ("hyper_part_off.i32", np.int32),
|
| 26 |
+
"hyper_part_tgt": ("hyper_part_tgt.i32", np.int32),
|
| 27 |
+
# Incidence: part node → hyperedges that contain it (reverse morphology).
|
| 28 |
+
"inc_off": ("inc_off.i32", np.int32),
|
| 29 |
+
"inc_hyper": ("inc_hyper.i32", np.int32),
|
| 30 |
+
# Parent node → hyperedges for which it is the derived word.
|
| 31 |
+
"par_off": ("par_off.i32", np.int32),
|
| 32 |
+
"par_hyper": ("par_hyper.i32", np.int32),
|
| 33 |
"lang_code": ("lang_code.u16", np.uint16),
|
| 34 |
"child_count": ("child_count.u16", np.uint16),
|
| 35 |
"lang_family": ("lang_family.u16", np.uint16),
|
|
|
|
| 42 |
"freq_rank": ("freq_rank.u32", np.uint32),
|
| 43 |
}
|
| 44 |
|
| 45 |
+
# Optional in older indexes (filled with empty arrays on load).
|
| 46 |
+
HYPER_KEYS = (
|
| 47 |
+
"hyper_parent",
|
| 48 |
+
"hyper_rel",
|
| 49 |
+
"hyper_conf",
|
| 50 |
+
"hyper_tmpl",
|
| 51 |
+
"hyper_part_off",
|
| 52 |
+
"hyper_part_tgt",
|
| 53 |
+
"inc_off",
|
| 54 |
+
"inc_hyper",
|
| 55 |
+
"par_off",
|
| 56 |
+
"par_hyper",
|
| 57 |
+
)
|
| 58 |
+
|
| 59 |
|
| 60 |
def mmap_dir(index_dir: Path) -> Path:
|
| 61 |
return Path(index_dir) / "mmap"
|
|
|
|
| 97 |
for key, (fname, dtype) in MMAP_FILES.items():
|
| 98 |
path = d / fname
|
| 99 |
if not path.exists():
|
| 100 |
+
# Backward compatible: older indexes without frequency / hyper arrays.
|
| 101 |
if key in ("freq_zipf", "freq_rank") and n_nodes is not None:
|
| 102 |
out[key] = np.zeros(n_nodes, dtype=dtype)
|
| 103 |
continue
|
| 104 |
+
if key in HYPER_KEYS and n_nodes is not None:
|
| 105 |
+
if key == "hyper_part_off":
|
| 106 |
+
out[key] = np.zeros(1, dtype=dtype) # 0 hyperedges
|
| 107 |
+
elif key in ("inc_off", "par_off"):
|
| 108 |
+
out[key] = np.zeros(n_nodes + 1, dtype=dtype)
|
| 109 |
+
elif key in (
|
| 110 |
+
"hyper_parent",
|
| 111 |
+
"hyper_rel",
|
| 112 |
+
"hyper_conf",
|
| 113 |
+
"hyper_tmpl",
|
| 114 |
+
"hyper_part_tgt",
|
| 115 |
+
"inc_hyper",
|
| 116 |
+
"par_hyper",
|
| 117 |
+
):
|
| 118 |
+
out[key] = np.zeros(0, dtype=dtype)
|
| 119 |
+
else:
|
| 120 |
+
out[key] = np.zeros(0, dtype=dtype)
|
| 121 |
+
continue
|
| 122 |
raise FileNotFoundError(path)
|
| 123 |
arr = open_array(path, dtype)
|
| 124 |
out[key] = np.array(arr) if copy else arr
|
frontend/dist/assets/index-Cp4-piqH.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
frontend/dist/assets/index-Cqu1pV49.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
@import"https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Source+Sans+3:wght@400;500;600;700&display=swap";.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;-moz-box-sizing:border-box;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}:root{--ink: #10161c;--ink-2: #182028;--ink-3: #222c36;--parchment: #f4efe4;--muted: #b7aea0;--line: rgba(244, 239, 228, .12);--teal: #3cb8c4;--copper: #e09a45;--moss: #7cb07c;--danger: #c45c5c;--radius: 14px;--font: "Source Sans 3", "Segoe UI", sans-serif;--display: "Fraunces", Georgia, serif}*{box-sizing:border-box}html,body,#root{height:100%;height:100dvh;margin:0;overflow:hidden}body{background:var(--ink);color:var(--parchment);font-family:var(--font);font-size:15px;-webkit-tap-highlight-color:transparent;touch-action:manipulation}button,input,select,textarea{font:inherit;color:inherit}button{cursor:pointer}button,a,input,select,label{touch-action:manipulation}.app{height:100%;display:grid;grid-template-rows:auto auto 1fr;background:radial-gradient(1200px 600px at 10% -10%,rgba(60,184,196,.08),transparent 50%),radial-gradient(900px 500px at 110% 0%,rgba(224,154,69,.07),transparent 46%),var(--ink)}.topbar{display:flex;gap:12px;align-items:center;padding:12px 16px 8px;border-bottom:1px solid var(--line)}.brand{display:flex;flex-direction:column;min-width:180px}.brand strong{font-family:var(--display);font-size:22px;letter-spacing:-.02em;font-weight:700}.brand span{color:var(--muted);font-size:12px}.search-wrap{position:relative;flex:1;min-width:0}.search-wrap input{width:100%;background:var(--ink-2);border:1px solid var(--line);border-radius:999px;padding:10px 16px 10px 40px;outline:none}.search-wrap input:focus{border-color:var(--teal)}.search-icon{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--muted)}.suggest{position:absolute;z-index:20;left:0;right:0;top:calc(100% + 6px);background:var(--ink-2);border:1px solid var(--line);border-radius:var(--radius);max-height:360px;overflow:auto;box-shadow:0 18px 40px #00000059}.suggest button{display:flex;width:100%;text-align:left;background:none;border:0;padding:10px 14px;gap:10px;align-items:baseline}.suggest button:hover,.suggest button.active{background:var(--ink-3)}.suggest .term{font-family:var(--display);font-size:17px}.suggest .meta{color:var(--muted);font-size:12px;margin-left:auto}.toolbar{display:flex;gap:8px;align-items:center;padding:8px 16px;flex-wrap:wrap;border-bottom:1px solid var(--line)}.seg{display:flex;background:var(--ink-2);border-radius:999px;padding:3px;border:1px solid var(--line)}.seg button,.chip,.ghost{background:transparent;border:0;color:var(--muted);padding:6px 12px;border-radius:999px}.seg button.on,.chip{background:var(--ink-3);color:var(--parchment)}.chip{border:1px solid var(--line);display:inline-flex;gap:6px;align-items:center;font-size:12px}.chip b{color:var(--teal);font-weight:600}.ghost{border:1px solid var(--line)}.ghost.primary{background:var(--teal);color:var(--ink);border-color:transparent;font-weight:600}.workspace{display:grid;grid-template-columns:320px 1fr 320px;min-height:0;position:relative;overflow:hidden}.panel{background:#182028b8;border-right:1px solid var(--line);overflow:auto;padding:14px;-webkit-overflow-scrolling:touch}.panel.right{border-right:0;border-left:1px solid var(--line)}.stage{position:relative;min-width:0;min-height:0;overflow:hidden;overscroll-behavior:none}.stage canvas,.stage .map,.stage .table-wrap,.stage .stats{position:absolute;inset:0;width:100%;height:100%}.viz-canvas{touch-action:none;display:block;cursor:grab;-webkit-user-select:none;user-select:none}.sheet-grab,.sheet-backdrop{display:none}.tabs{display:flex;gap:6px;margin-bottom:12px}.tabs button{flex:1;background:var(--ink-2);border:1px solid var(--line);border-radius:10px;padding:7px;color:var(--muted)}.tabs button.on{color:var(--parchment);border-color:var(--teal)}label.field{display:block;font-size:12px;color:var(--muted);margin:10px 0 4px}.row{display:flex;gap:8px;align-items:center}select,.field-input{width:100%;background:var(--ink);border:1px solid var(--line);border-radius:10px;padding:8px 10px}.checklist{max-height:140px;overflow:auto;border:1px solid var(--line);border-radius:10px;background:var(--ink)}.checklist label{display:flex;gap:8px;padding:5px 8px;font-size:13px;color:var(--parchment)}.rel-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px}.rel-grid label{display:flex;gap:6px;font-size:13px;align-items:center}.dot{width:8px;height:8px;border-radius:50%;display:inline-block}.legend{position:absolute;left:12px;bottom:12px;background:#10161cd1;border:1px solid var(--line);border-radius:12px;padding:8px 10px;font-size:12px;display:flex;flex-wrap:wrap;gap:8px 12px;max-width:min(520px,calc(100% - 24px))}.status-line{position:absolute;right:12px;bottom:12px;color:var(--muted);font-size:12px;background:#10161cb8;padding:6px 10px;border-radius:999px}.table-wrap{overflow:auto;padding:8px 12px 48px}table{width:100%;border-collapse:collapse;font-size:13px}th,td{text-align:left;padding:8px;border-bottom:1px solid var(--line)}th{color:var(--muted);font-weight:600;position:sticky;top:0;background:var(--ink)}tr:hover td{background:var(--ink-3);cursor:pointer}.stats{overflow:auto;padding:18px}.bars{display:grid;gap:6px}.bar-row{display:grid;grid-template-columns:140px 1fr 40px;gap:8px;align-items:center;font-size:13px}.bar{height:8px;background:var(--ink-3);border-radius:99px;overflow:hidden}.bar>i{display:block;height:100%;background:var(--teal)}.inspector h2{font-family:var(--display);margin:0 0 4px;font-size:28px}.inspector-def{margin:12px 0 4px}.inspector-def h3{margin:0 0 6px;font-size:12px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);font-weight:600}.kv{display:grid;grid-template-columns:110px 1fr;gap:4px 8px;font-size:13px;margin:12px 0}.kv dt{color:var(--muted)}.path-list{display:flex;flex-direction:column;gap:6px}.path-list button{background:var(--ink);border:1px solid var(--line);border-radius:10px;padding:8px;text-align:left}.formation-list{display:flex;flex-direction:column;gap:10px;margin:0 0 12px}.formation-meta{font-size:12px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin-bottom:4px}.formation-parts{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 0}.formation-plus{color:var(--muted);padding:0 4px}.formation-part{background:transparent;border:0;border-bottom:1px solid color-mix(in srgb,var(--teal) 55%,transparent);border-radius:0;padding:2px 2px 1px;text-align:left;font-family:var(--display);font-size:18px;line-height:1.2}.formation-part small{display:block;font-family:var(--font);font-size:11px;color:var(--muted);font-weight:500}.formation-part:hover{color:var(--teal)}.sheet{display:none}.examples{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:8px;padding:16px}.examples button{background:var(--ink-2);border:1px solid var(--line);border-radius:12px;padding:12px;text-align:left}.examples .t{font-family:var(--display);font-size:18px;display:block}.examples .b{color:var(--muted);font-size:12px}.qr img{width:180px;height:180px;background:#fff;padding:8px;border-radius:8px}.modal-root{position:fixed;inset:0;z-index:80;display:grid;place-items:center;padding:16px}.modal-backdrop{position:absolute;inset:0;border:0;padding:0;background:#060a0e9e;cursor:pointer}.modal-dialog{position:relative;z-index:1;width:min(560px,100%);max-height:min(86dvh,820px);display:flex;flex-direction:column;background:radial-gradient(700px 240px at 0% 0%,rgba(60,184,196,.12),transparent 55%),var(--ink-2);border:1px solid var(--line);border-radius:18px;box-shadow:0 24px 60px #00000073;overflow:hidden}.modal-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;padding:16px 16px 10px;border-bottom:1px solid var(--line)}.modal-head h2{font-family:var(--display);margin:0;font-size:28px;line-height:1.1}.modal-head p{margin:4px 0 0;color:var(--muted);font-size:13px}.modal-body{overflow:auto;-webkit-overflow-scrolling:touch;padding:8px 16px 16px;flex:1;min-height:0}.modal-body section{margin-top:14px}.modal-body h3{margin:0 0 6px;font-size:12px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);font-weight:600}.modal-muted{color:var(--muted);font-size:13px;margin:0}.modal-muted a{color:var(--teal)}.modal-senses{display:grid;gap:10px}.modal-pos{font-size:12px;color:var(--copper);font-style:italic;margin-bottom:2px}.modal-sense ol{margin:0;padding-left:18px;display:grid;gap:4px}.modal-sense li{font-size:14px;line-height:1.35}.modal-chips{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 0}.modal-foot{display:flex;flex-wrap:wrap;gap:8px;padding:12px 16px 16px;border-top:1px solid var(--line)}.modal-foot .ghost,.modal-foot a.ghost{text-decoration:none;display:inline-flex;align-items:center;min-height:40px}@media(max-width:840px){.workspace{grid-template-columns:1fr}.panel{display:none}.sheet-backdrop{display:block;position:absolute;inset:0;z-index:25;border:0;background:#00000073;padding:0}.panel.open-sheet{display:flex;flex-direction:column;position:absolute;left:0;right:0;bottom:0;z-index:30;height:min(78dvh,640px);max-height:calc(100% - 12px);border-right:0;border-left:0;border-top:1px solid var(--line);border-radius:18px 18px 0 0;background:var(--ink-2);padding:0 14px 18px;overflow:hidden;box-shadow:0 -12px 40px #00000059}.sheet-body{overflow:auto;-webkit-overflow-scrolling:touch;flex:1;min-height:0}.sheet-grab{display:grid;grid-template-columns:64px 1fr auto;align-items:center;gap:8px;padding:10px 0 8px;position:sticky;top:0;background:var(--ink-2);z-index:1}.sheet-grab>span{width:42px;height:4px;border-radius:99px;background:#f4efe447;justify-self:start;margin-left:10px}.sheet-grab strong{font-size:14px;font-weight:600}.sheet-close{padding:8px 12px;min-height:40px}.brand{min-width:0}.brand span{display:none}.brand strong{font-size:18px}.topbar{padding:10px;gap:8px}.toolbar{padding:8px 10px;gap:6px;flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}.toolbar::-webkit-scrollbar{display:none}.seg{flex:0 0 auto}.seg button{padding:8px 10px;min-height:36px}.filters-btn{flex:0 0 auto;min-height:40px}.legend{display:none}.status-line{left:12px;right:12px;bottom:10px;text-align:center}.search-wrap input{padding:12px 16px 12px 40px;font-size:16px}.suggest{max-height:min(50dvh,320px)}.suggest button{padding:12px 14px;min-height:44px}.checklist{max-height:180px}.checklist label{padding:10px 8px;min-height:40px}}
|
frontend/dist/index.html
CHANGED
|
@@ -9,8 +9,8 @@
|
|
| 9 |
<link rel="icon" href="/icon.svg" type="image/svg+xml" />
|
| 10 |
<link rel="apple-touch-icon" href="/icon.svg" />
|
| 11 |
<title>Reverse Etymology Atlas</title>
|
| 12 |
-
<script type="module" crossorigin src="/assets/index-
|
| 13 |
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
| 14 |
</head>
|
| 15 |
<body>
|
| 16 |
<div id="root"></div>
|
|
|
|
| 9 |
<link rel="icon" href="/icon.svg" type="image/svg+xml" />
|
| 10 |
<link rel="apple-touch-icon" href="/icon.svg" />
|
| 11 |
<title>Reverse Etymology Atlas</title>
|
| 12 |
+
<script type="module" crossorigin src="/assets/index-Cp4-piqH.js"></script>
|
| 13 |
+
<link rel="stylesheet" crossorigin href="/assets/index-Cqu1pV49.css">
|
| 14 |
</head>
|
| 15 |
<body>
|
| 16 |
<div id="root"></div>
|