semvec/pypi-packages huggingface dataset:
annotated 0.0.2
Apply annotations as callables on their respective arguments
License: MIT
Keywords: annotations decorator function development

Annotated
=========
Annotated provides a decorator that flags a function's annotations as useful, callable expressions. Each annotation will be called with its corresponding argument as first parameter, and the result will replace that argument.

If no annotation was specified for this particular argument, it will behave as if `lambda x: x` had been used as annotation.

`@annotated` Decorator
----------------------
The `@annotated` decorator is meant to decorate functions, or other objects with a `__code__` attribute (a class is **not** one). It indicates that the function decorated has "active" annotations, for example:

```python
from annotated import annotated

@annotated
def hello(name: str):
    print('Hello, ' + name + '!')

hello('world')
# "Hello, world!"
hello(None)
# "Hello, None!"
```

Albeit a bad example (one would rather use `str.format` or the `%` notation to include a value in a string), this illustrates the behaviour of an `@annotated` function.

Used this way, `@annotated` ensures that the `name` argument of the `hello` function is **always** a character string.

`@annotated` also respects default values, and applies annotations to them. Thus, if we were to rewrite `hello` such as:

```python
from annotated import annotated

@annotated
def hello(name: str='world'):
    print('Hello, ' + name + '!')

hello()
# "Hello, world!"
```

The default value would be honored, as well as any non-defaults.

It should be noted that `@annotated` supports both return annotations (`->`), keyword argument annotations and `*`/`**` annotations.

Using `@annotated` on an incompatible (`__code__`-less) object will result in a `TypeError` exception.
chop 1.0
Chinese Words Segementation Utilities
License: MIT
Keywords: NLP


chop
=====

中文分词

完整文档见

GitHub: https://github.com/samurais/chop

特点
====

* 使用简单

```python
for x in t.cut("工信处女干事每月经过下属科室都要亲口交代24口交换机等技术性器件的安装工作"): print(x)
```

* 代码通俗易懂，方便掌握算法

-  MIT 授权协议

安装说明
========

代码对 Python 3 兼容

-  全自动安装： ``easy_install chop`` 或者 ``pip install chop`` / ``pip3 install chop``
-  通过 ``import chop`` 来引用