searcharray 0.0.16__tar.gz → 0.0.17__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {searcharray-0.0.16 → searcharray-0.0.17}/PKG-INFO +1 -1
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray/postings.py +3 -1
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray.egg-info/PKG-INFO +1 -1
- {searcharray-0.0.16 → searcharray-0.0.17}/setup.py +1 -1
- {searcharray-0.0.16 → searcharray-0.0.17}/test/test_tmdb.py +7 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/README.md +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/pyproject.toml +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray/__init__.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray/phrase/__init__.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray/phrase/middle_out.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray/phrase/padded_arrays.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray/phrase/posn_diffs.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray/phrase/scan_merge.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray/stemmers.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray/term_dict.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray/utils/__init__.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray/utils/bitcount.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray/utils/mat_set.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray/utils/roaringish.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray/utils/row_viewable_matrix.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray.egg-info/SOURCES.txt +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray.egg-info/dependency_links.txt +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray.egg-info/entry_points.txt +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray.egg-info/requires.txt +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/searcharray.egg-info/top_level.txt +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/setup.cfg +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/test/test_extension_array.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/test/test_msmarco.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/test/test_phrase_matches.py +0 -0
- {searcharray-0.0.16 → searcharray-0.0.17}/test/test_utils.py +0 -0
|
@@ -603,7 +603,9 @@ class PostingsArray(ExtensionArray):
|
|
|
603
603
|
term_id = self.term_dict.get_term_id(token)
|
|
604
604
|
matches = np.zeros(len(self), dtype=int)
|
|
605
605
|
doc_ids, termfreqs = self.posns.termfreqs(term_id)
|
|
606
|
-
|
|
606
|
+
doc_ids_in_matches = np.intersect1d(self.term_freqs.rows, doc_ids).astype(np.uint32)
|
|
607
|
+
mask = np.isin(self.term_freqs.rows, doc_ids_in_matches)
|
|
608
|
+
matches[mask] = termfreqs
|
|
607
609
|
return matches
|
|
608
610
|
except TermMissingError:
|
|
609
611
|
return np.zeros(len(self), dtype=int)
|
|
@@ -36,7 +36,7 @@ setup(
|
|
|
36
36
|
# For a discussion on single-sourcing the version across setup.py and the
|
|
37
37
|
# project code, see
|
|
38
38
|
# https://packaging.python.org/guides/single-sourcing-package-version/
|
|
39
|
-
version="0.0.
|
|
39
|
+
version="0.0.17", # Required
|
|
40
40
|
# This is a one-line description or tagline of what your project does. This
|
|
41
41
|
# corresponds to the "Summary" metadata field:
|
|
42
42
|
# https://packaging.python.org/specifications/core-metadata/#summary
|
|
@@ -84,6 +84,13 @@ def test_tokenize_tmdb(tmdb_raw_data):
|
|
|
84
84
|
assert len(df) == len(ids)
|
|
85
85
|
|
|
86
86
|
|
|
87
|
+
def test_slice_then_search(tmdb_data):
|
|
88
|
+
star_wars_in_title = tmdb_data['title_tokens'].array.match(["Star", "Wars"])
|
|
89
|
+
star_wars_in_title = tmdb_data[star_wars_in_title]
|
|
90
|
+
skywalker_bm25 = star_wars_in_title['overview_tokens'].array.bm25(["Skywalker"])
|
|
91
|
+
assert skywalker_bm25.shape[0] == 3
|
|
92
|
+
|
|
93
|
+
|
|
87
94
|
tmdb_phrase_matches = [
|
|
88
95
|
(["Star", "Wars"], ['11', '330459', '76180']),
|
|
89
96
|
(["Black", "Mirror:"], ['374430']),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|