Первый запуск

This commit is contained in:
KuzarinM
2026-05-02 18:33:38 +03:00
commit cb55eaef01
51 changed files with 2127373 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
from typing import List, Union
from Processor.Models.LogVariable import LogVariable
class LogTemplate:
def __init__(self, uid: int, tokens: List[Union[str, LogVariable]], representative_log: str):
self.uid = uid
self.tokens = tokens
self.representative_log = representative_log
self.embedding = None
self.hits = 1
self.local_var_counter = 1
def get_tokens_as_str_list(self) -> List[str]:
return [str(t) if isinstance(t, LogVariable) else t for t in self.tokens]
def render(self) -> str:
return "".join(str(t) for t in self.tokens)
def get_next_var_id(self) -> int:
vid = self.local_var_counter
self.local_var_counter += 1
return vid

View File

@@ -0,0 +1,12 @@
class LogVariable:
def __init__(self, uid: int, initial_value: str = "", var_type: str = "VAR"):
self.uid = uid
self.initial_value = initial_value
self.var_type = var_type
def __str__(self):
return f"<{self.var_type}_{self.uid}>"
def __repr__(self):
return str(self)