diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index fb7445d..2cc0496 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,4 +1,4 @@ -name: build & test +name: Build & test using current Python versions on: [workflow_dispatch, push] diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6ecfebf..add7b54 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Create Dist & Publish on PyPI +name: Create source distribution & publish on PyPI on: workflow_dispatch: @@ -12,24 +12,23 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install CWB run: | sudo apt-get install libncurses5-dev - svn co http://svn.code.sf.net/p/cwb/code/cwb/trunk cwb - cd cwb - sed -i 's/SITE=beta-install/SITE=standard/' config.mk - sudo ./install-scripts/install-linux - sudo ldconfig + wget https://kumisystems.dl.sourceforge.net/project/cwb/cwb/cwb-3.5/deb/cwb_3.5.0-1_amd64.deb + wget https://master.dl.sourceforge.net/project/cwb/cwb/cwb-3.5/deb/cwb-dev_3.5.0-1_amd64.deb + sudo apt-get install ./cwb_3.5.0-1_amd64.deb + sudo apt-get install ./cwb-dev_3.5.0-1_amd64.deb - name: Set up Python 3.12 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.12' - name: Install dependencies run: | python -m pip install --upgrade pip make install - - name: Create Dist + - name: Create source distribution run: | make sdist - name: Publish diff --git a/ccc/cwb.py b/ccc/cwb.py index 29fea8e..fc1e538 100644 --- a/ccc/cwb.py +++ b/ccc/cwb.py @@ -1477,7 +1477,7 @@ def correct_anchors(self, corrections): """ self.df = correct_anchors(self.df, corrections) - def breakdown(self, p_atts=['word'], flags="", split=False): + def breakdown(self, p_atts=['word'], flags="", split=False, start='match', end='matchend'): """Frequency breakdown of match..matchend. """ @@ -1485,7 +1485,7 @@ def breakdown(self, p_atts=['word'], flags="", split=False): logger.info('creating frequency breakdown') breakdown = self.counts.dump( df_dump=self.df, - start='match', end='matchend', + start=start, end=end, p_atts=p_atts, split=split ) diff --git a/ccc/version.py b/ccc/version.py index ceca084..d4952fa 100644 --- a/ccc/version.py +++ b/ccc/version.py @@ -4,4 +4,4 @@ """ -__version__ = "0.12.2" +__version__ = "0.12.3" diff --git a/tests/test_10_dumps.py b/tests/test_10_dumps.py index 4147097..d814b95 100644 --- a/tests/test_10_dumps.py +++ b/tests/test_10_dumps.py @@ -55,6 +55,13 @@ def test_breakdown_p_att(germaparl): assert breakdown.loc['gehen']['freq'] == 224 +def test_breakdown_anchor(germaparl): + corpus = get_corpus(germaparl) + restricted = corpus.query('[pos="APPR"]@1[pos="ADJA"][pos="NN"]') + bd = restricted.breakdown(p_atts=['lemma'], start=1, end=1) + assert bd.sort_values(by='freq', ascending=False).index[0] == 'neu' + + def test_matches(germaparl): corpus = get_corpus(germaparl) dump = corpus.query('"SPD"')