Skip to main content

functionwords

License: CC BY-NC-SA 4.0

The functionwords package aims at providing curated Chinese and English function words.

For now, it supports four function word lists: modern Chinese ([chinese_simplified_modern][1]), classical Chinese ([chinese_classical_naive][2] and [chinese_classical_comprehensive][3]), and modern English (english). Chinese function words are only available in simplified form.

The FunctionWords class does the heavy lifting. Initiate it with the desired function word list name. The instance has two methods transform() and get_feature_names()) and three attributes (name, function_words, and description).

Name # of function words        Description        
chinese_simplified_modern 819 compiled from the [dictionary][1]
chinese_classical_naive 32 harvested from the [platforms][2]
chinese_classical_comprehensive 466 compiled from the [dictionary][3]
english 512 found in software

For more details, see FunctionWords instance's attribute description.

Installation

pip install -U functionwords

Getting started

from functionwords import FunctionWords

raw = "The present King of Singapore is bald."

# to instantiate a FunctionWords instance
# `name` can be either 'chinese_classical_comprehensive', 
# 'chinese_classical_naive', 'chinese_simplified_modern', or 'english'
fw = FunctionWords(name='english')

# to count function words accordingly
# returns a list of counts
fw.transform(raw)

# to list all function words given `name`
# returns a list
fw.get_feature_names(raw)

Requirements

Only python 3.8+ is required.

Licence

This package is licensed under CC-BY-SA 4.0.

To do

  • Finish the tests.

References

[1]: Ziqiang, W. (1998). Modern Chinese Dictionary of Function Words. Shanghai Dictionary Press.

[2]: https://baike.baidu.com/item/%E6%96%87%E8%A8%80%E8%99%9A%E8%AF%8D and https://zh.m.wikibooks.org/zh-hans/%E6%96%87%E8%A8%80/%E8%99%9B%E8%A9%9E

[3]: Hai, W., Changhai, Z., Shan, H., Keying, W. (1996). Classical Chinese Dictionary of Function Words. Peking University Press.

Metadata

Release files for functionwords 0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for functionwords 0.6
File Size Uploaded Provenance Actions
functionwords-0.6.tar.gz 11.0 kB Without provenance Details for functionwords-0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for functionwords 0.6
File Interpreter ABI Platform Actions
functionwords-0.6-py3-none-any.whl Python 3 none any Details for functionwords-0.6-py3-none-any.whl

Total release size: 21.7 kB

Release files / functionwords-0.6.tar.gz

Download URL functionwords-0.6.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4e830f51f7fb570f2376624afa84558253d764e46108b0467930be02ef8e7548
BLAKE2b-256 checksum
How to use checksums
1c2e6e9637bb0297386ed2ee1597da715500fb9ccb5ff0dc648a84368fac8310
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.8.5 Darwin/21.1.0

Release files / functionwords-0.6-py3-none-any.whl

Download URL functionwords-0.6-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a974beffbb09f94eb8d413b23984cd2168fb300adcf097ad40b77e923945ffb9
BLAKE2b-256 checksum
How to use checksums
8045b0ce848ce52ad279eea77698dedfb7f5010d3fb7c0d7a03fadc4bd4bd109
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.8.5 Darwin/21.1.0

Security for functionwords 0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page