Skip to content

Commit

Permalink
Correctly reference package resources in CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
thatbudakguy committed Feb 12, 2021
1 parent 1bc2a5c commit 2241c06
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dphon/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import logging
import time
import os
import pkg_resources
from itertools import combinations
from pathlib import Path
from typing import Dict
Expand Down Expand Up @@ -130,8 +131,9 @@ def run() -> None:
def setup(args: Dict) -> Language:
"""Set up the spaCy processing pipeline."""
# get sound table
sound_table = get_sound_table_json(
Path("./dphon/data/sound_table_v2.json"))
v2_path = pkg_resources.resource_filename(
__package__, "data/sound_table_v2.json")
sound_table = get_sound_table_json(Path(v2_path))

# add Doc metadata
if not Doc.has_extension("id"):
Expand Down

0 comments on commit 2241c06

Please sign in to comment.