dataherb.core.search
core.search¤
search_by_ids_in_flora(flora, ids)
¤
search_in_flora finds the herb with the corresponding ids
Parameters:
Name | Type | Description | Default |
---|---|---|---|
flora |
List[Herb]
|
list of herbs |
required |
ids |
Sequence[str]
|
ids of the herbs to be located |
required |
Returns:
Type | Description |
---|---|
list
|
herbs that matches the id |
Source code in dataherb/core/search.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
search_by_keywords_in_flora(flora, keywords, keys=None, min_score=50)
¤
search_in_flora calculates the match score of each herb and returns the top 10.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
flora |
List[Herb]
|
list of herbs |
required |
keywords |
List[str]
|
search keywords |
required |
keys |
Optional[List[str]]
|
list of dictionary keys to look into |
None
|
min_score |
float
|
minimum score of the dataset, default to 50 |
50
|
Source code in dataherb/core/search.py
6 7 8 9 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 |
|