Skip to content

Commit

Permalink
Citation code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhongsun96 committed Dec 1, 2024
1 parent 9bd0cb9 commit 3432d93
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def process_token(
if piece_that_comes_after == "\n" and in_code_block(self.llm_out):
self.curr_segment = self.curr_segment.replace("```", "```plaintext")

citation_pattern = r"\[(\d+)\]|\[\[(\d+)\]\]"
citation_pattern = r"\[(\d+)\]|\[\[(\d+)\]\]" # [1], [[1]], etc.
citations_found = list(re.finditer(citation_pattern, self.curr_segment))
possible_citation_pattern = r"(\[+\d*$)"
possible_citation_pattern = r"(\[+\d*$)" # [1, [, [[, [[2, etc.
possible_citation_found = re.search(
possible_citation_pattern, self.curr_segment
)
Expand Down

0 comments on commit 3432d93

Please sign in to comment.