Skip to content

Commit

Permalink
Merge pull request #81 from ausgerechnet/v0.12.3
Browse files Browse the repository at this point in the history
v0.12.3
  • Loading branch information
ausgerechnet authored Oct 18, 2024
2 parents 36ae283 + 5e83811 commit a397d43
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build & test
name: Build & test using current Python versions

on: [workflow_dispatch, push]

Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create Dist & Publish on PyPI
name: Create source distribution & publish on PyPI

on:
workflow_dispatch:
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ccc/cwb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1477,15 +1477,15 @@ 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.
"""

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
)

Expand Down
2 changes: 1 addition & 1 deletion ccc/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"""

__version__ = "0.12.2"
__version__ = "0.12.3"
7 changes: 7 additions & 0 deletions tests/test_10_dumps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"')
Expand Down

0 comments on commit a397d43

Please sign in to comment.