Store
ExampleStore
¶
Source code in recon/store.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
__contains__(example)
¶
Check whether a string is in the store.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
example |
Union[int, Example]
|
The example to check |
required |
Returns:
Type | Description |
---|---|
bool
|
Whether the store contains the example. |
Source code in recon/store.py
27 28 29 30 31 32 33 34 35 36 37 |
|
__len__()
¶
The number of strings in the store.
Returns:
Type | Description |
---|---|
int
|
Number of examples in store |
Source code in recon/store.py
19 20 21 22 23 24 25 |
|
add(example)
¶
Add an Example to the store
Parameters:
Name | Type | Description | Default |
---|---|---|---|
example |
Example
|
example to add |
required |
Source code in recon/store.py
39 40 41 42 43 44 45 46 47 |
|
from_disk(path)
¶
Load store from disk
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path
|
Path to file to load from |
required |
Returns:
Name | Type | Description |
---|---|---|
ExampleStore |
ExampleStore
|
Initialized ExampleStore |
Source code in recon/store.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
to_disk(path)
¶
Save store to disk
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path
|
Path to save store to |
required |
Source code in recon/store.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|