Skip to content

Commit

Permalink
chore: desc
Browse files Browse the repository at this point in the history
  • Loading branch information
williamfzc committed Nov 22, 2023
1 parent c18069e commit e70b1b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "srctag"
version = "0.1.1"
description = "Tag source files with real-world requirements."
description = "Tag source files with real-world stories."
authors = ["williamfzc <[email protected]>"]
license = "Apache-2.0"
readme = "README.md"
Expand Down
6 changes: 5 additions & 1 deletion srctag/tagger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import csv
import typing
from collections import OrderedDict

from chromadb import QueryResult, Metadata
from pydantic import BaseModel
Expand All @@ -12,6 +13,7 @@


class TagResult(BaseModel):
# todo: need some other ways for querying flexibly
files: typing.Dict[str, SingleTagResult] = dict()

def export_csv(self, path: str = "srctag-output.csv") -> None:
Expand Down Expand Up @@ -73,7 +75,9 @@ def tag(self, storage: Storage) -> TagResult:
for each_file, each_score in zip(files, normalized_scores):
each_file_name = each_file["source"]
if each_file_name not in ret:
ret[each_file_name] = dict()
ret[each_file_name] = OrderedDict()
ret[each_file_name][each_tag] = each_score
# END file loop
# END tag loop

return TagResult(files=ret)

0 comments on commit e70b1b6

Please sign in to comment.