Skip to content

Commit

Permalink
Merge pull request #218 from NationalLibraryOfNorway/fix/sparse
Browse files Browse the repository at this point in the history
set sparse = True for counting
  • Loading branch information
magbb authored Oct 1, 2024
2 parents 0d38b0d + 17335f9 commit 961696b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dhlab/text/conc_coll.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def from_df(cls, df):
class Counts(DhlabObj):
"""Provide counts for a corpus - shouldn't be too large"""

def __init__(self, corpus=None, words=None, cutoff=0, sparse=False):
def __init__(self, corpus=None, words=None, cutoff=0, sparse=True):
"""Get frequency list for Corpus
:param corpus: target Corpus, defaults to None
Expand Down
4 changes: 2 additions & 2 deletions dhlab/text/corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ def coll(
ignore_caps=ignore_caps,
)

def count(self, words=None, cutoff=0, sparse=False):
def count(self, words=None, cutoff=0, sparse=True):
"""Get word frequencies for corpus"""
return dh.Counts(self, words, cutoff, sparse)

def freq(self, words=None, cutoff=0, sparse=False):
def freq(self, words=None, cutoff=0, sparse=True):
"""Get word frequencies for corpus"""
return dh.Counts(self, words, cutoff, sparse)

Expand Down

0 comments on commit 961696b

Please sign in to comment.