From b870f917dd553a168285a3474dbd6742cf859220 Mon Sep 17 00:00:00 2001 From: nsantacruz Date: Mon, 17 Jun 2024 11:28:01 +0300 Subject: [PATCH] feat: basic style_guide.py --- app/topic_prompt/style_guide.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 app/topic_prompt/style_guide.py diff --git a/app/topic_prompt/style_guide.py b/app/topic_prompt/style_guide.py new file mode 100644 index 0000000..b1d5d80 --- /dev/null +++ b/app/topic_prompt/style_guide.py @@ -0,0 +1,24 @@ +""" +Make prompts conform to the style guide +""" +import csv + + +class StyleGuide: + STYLE_GUIDE_FILE = "input/The Sefaria Glossary - English + Transliterated Word List.csv" + + def __init__(self): + self._rules = self._read_style_guide_file() + + def _read_style_guide_file(self): + rules = [] + with open(self.STYLE_GUIDE_FILE, "r") as fin: + cin = csv.reader(fin) + for row in list(cin)[4:]: + rules.append(row[0].strip()) + return rules + + +if __name__ == '__main__': + s = StyleGuide() + print(s._rules) \ No newline at end of file