5 |
5 |
6 """ |
6 """ |
7 Module implementing the AdBlock search tree. |
7 Module implementing the AdBlock search tree. |
8 """ |
8 """ |
9 |
9 |
10 from .AdBlockRule import AdBlockRuleType |
10 from dataclasses import dataclass, field |
|
11 |
|
12 from .AdBlockRule import AdBlockRule, AdBlockRuleType |
11 |
13 |
12 |
14 |
|
15 @dataclass |
13 class AdBlockSearchTreeNode: |
16 class AdBlockSearchTreeNode: |
14 """ |
17 """ |
15 Class implementing the AdBlock search tree node. |
18 Class implementing the AdBlock search tree node. |
16 """ |
19 """ |
17 |
20 |
18 def __init__(self): |
21 char: str = "" |
19 """ |
22 rule: AdBlockRule = None |
20 Constructor |
23 children: dict = field(default_factory=dict) |
21 """ |
|
22 self.char = "" |
|
23 self.rule = None |
|
24 self.children = {} |
|
25 |
24 |
26 |
25 |
27 class AdBlockSearchTree: |
26 class AdBlockSearchTree: |
28 """ |
27 """ |
29 Class implementing the AdBlock search tree. |
28 Class implementing the AdBlock search tree. |