mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-21 16:28:17 +00:00
Fix: Assignment keywords extracting
This commit is contained in:
parent
13d8c9100d
commit
8a571f79c9
@ -556,7 +556,7 @@ class KeywordExtract:
|
|||||||
self.load_keywords(['本周任务', '本期任务'])
|
self.load_keywords(['本周任务', '本期任务'])
|
||||||
self.write_keywords(keyword_class='BattlePassMissionTab',
|
self.write_keywords(keyword_class='BattlePassMissionTab',
|
||||||
output_file='./tasks/battle_pass/keywords/mission_tab.py')
|
output_file='./tasks/battle_pass/keywords/mission_tab.py')
|
||||||
# self.generate_assignments()
|
self.generate_assignments()
|
||||||
self.generate_forgotten_hall_stages()
|
self.generate_forgotten_hall_stages()
|
||||||
self.generate_daily_quests()
|
self.generate_daily_quests()
|
||||||
self.generate_battle_pass_quests()
|
self.generate_battle_pass_quests()
|
||||||
|
@ -59,7 +59,7 @@ def get_assignment_entry_data():
|
|||||||
for expedition_namehash, expedition_id in expedition_namehash_to_id.items():
|
for expedition_namehash, expedition_id in expedition_namehash_to_id.items():
|
||||||
reward_id = expedition_id_to_reward_id[expedition_id]
|
reward_id = expedition_id_to_reward_id[expedition_id]
|
||||||
item_ids = reward_id_to_item_ids[reward_id]
|
item_ids = reward_id_to_item_ids[reward_id]
|
||||||
item_names = [item_id_to_namehash[x] for x in item_ids]
|
item_names = [item_id_to_namehash[x] for x in item_ids if x]
|
||||||
if len(item_names) == 1:
|
if len(item_names) == 1:
|
||||||
item = GenerateKeyword.find_keyword(item_names[0], lang='cn')[1]
|
item = GenerateKeyword.find_keyword(item_names[0], lang='cn')[1]
|
||||||
if item in item_name_remap:
|
if item in item_name_remap:
|
||||||
@ -128,6 +128,7 @@ class GenerateAssignmentEventGroup(GenerateKeyword):
|
|||||||
def iter_keywords(self) -> Iterable[dict]:
|
def iter_keywords(self) -> Iterable[dict]:
|
||||||
yield dict(text_id=self.find_keyword('空间站特派', lang='cn')[0])
|
yield dict(text_id=self.find_keyword('空间站特派', lang='cn')[0])
|
||||||
yield dict(text_id=self.find_keyword('关于波提欧的一切…', lang='cn')[0])
|
yield dict(text_id=self.find_keyword('关于波提欧的一切…', lang='cn')[0])
|
||||||
|
yield dict(text_id=self.find_keyword('游侠谜影', lang='cn')[0])
|
||||||
|
|
||||||
|
|
||||||
class GenerateAssignmentEventEntry(GenerateKeyword):
|
class GenerateAssignmentEventEntry(GenerateKeyword):
|
||||||
@ -141,5 +142,5 @@ class GenerateAssignmentEventEntry(GenerateKeyword):
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from dev_tools.keywords.base import TextMap
|
from dev_tools.keywords.base import TextMap
|
||||||
|
|
||||||
TextMap.DATA_FOLDER = '../StarRailData'
|
TextMap.DATA_FOLDER = '../DanhengServer-Resources'
|
||||||
GenerateAssignment()()
|
GenerateAssignment()()
|
||||||
|
@ -68,6 +68,7 @@ def text_to_variable(text):
|
|||||||
text = re.sub(r'[(),#"?!&%*]|</?\w+>', '', text)
|
text = re.sub(r'[(),#"?!&%*]|</?\w+>', '', text)
|
||||||
# text = re.sub(r'[#_]?\d+(_times?)?', '', text)
|
# text = re.sub(r'[#_]?\d+(_times?)?', '', text)
|
||||||
text = re.sub(r'<color=#?\w+>', '', text)
|
text = re.sub(r'<color=#?\w+>', '', text)
|
||||||
|
text = re.sub(r'^\d+', '', text)
|
||||||
text = text.replace('é', 'e')
|
text = text.replace('é', 'e')
|
||||||
return text.strip('_')
|
return text.strip('_')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user