Skip to content

Commit a9ed20a

Browse files
committed
Use entity resource type for weekday loading
1 parent 07e556a commit a9ed20a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from ovos_utils.time import now_local, get_next_leap_year
3030
from ovos_utterance_normalizer import UtteranceNormalizerPlugin
3131
from ovos_workshop.decorators import intent_handler
32+
from ovos_workshop.resource_files import ResourceFile
3233
from ovos_workshop.skills import OVOSSkill
3334
from timezonefinder import TimezoneFinder
3435

@@ -168,10 +169,10 @@ def _load_cached_entity(self, name: str):
168169
"""Load and cache a locale entity resource."""
169170
cache_key = f"{self.lang}:{name}.entity"
170171
if cache_key not in self.resources.static:
172+
entity_resource = ResourceFile(self.resources.types.entity, name)
171173
values = []
172-
entity_file = self.find_resource(f"{name}.entity", "vocab")
173-
if entity_file:
174-
with open(entity_file, encoding="utf-8") as f:
174+
if entity_resource.file_path:
175+
with open(entity_resource.file_path, encoding="utf-8") as f:
175176
for line in f:
176177
line = line.strip()
177178
if line and not line.startswith("#"):

0 commit comments

Comments
 (0)