Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hpprc/japanese-sentence-breaker

๐Ÿงจ Japanese Sentence Breaker ๐Ÿงจ
https://github.com/hpprc/japanese-sentence-breaker

japanese python

Last synced: 17 days ago
JSON representation

๐Ÿงจ Japanese Sentence Breaker ๐Ÿงจ

Awesome Lists containing this project

README

        

# Japanese Sentence Breaker

ๆ—ฅๆœฌ่ชžใฎๆ–‡ใ‚’ใ€Œใ€‚ใ€ใ‚’ๅŸบๆบ–ใซๆ”น่กŒๅŒบๅˆ‡ใ‚Šใ—ใพใ™ใ€‚

## Instllation

```bash
pip install japanese-sentence-breaker
```

## Usage

```python
from japanese_sentence_breaker import break_line

text = "ใ“ใ‚Œใฏใƒ†ใ‚นใƒˆใงใ™ใ€‚ๆ–‡ใฎๆตใ‚Œใ‚’่€ƒๆ…ฎใ—ใ€ๅฅ็‚นๅŒบๅˆ‡ใ‚Šใงๆ–‡็ซ ใ‚’ๅˆ†ๅ‰ฒใ—ใพใ™ใ€‚ใ€Œไพ‹ใˆใฐใ€‚ใ€ใ“ใฎใ‚ˆใ†ใชใ‚ซใƒƒใ‚ณๅ†…ใฎใƒ†ใ‚ญใ‚นใƒˆใฏๅˆ†ๅ‰ฒใ—ใพใ›ใ‚“ใ€‚"
out = break_line(text)

print(out)
# ใ“ใ‚Œใฏใƒ†ใ‚นใƒˆใงใ™ใ€‚
# ๆ–‡ใฎๆตใ‚Œใ‚’่€ƒๆ…ฎใ—ใ€ๅฅ็‚นๅŒบๅˆ‡ใ‚Šใงๆ–‡็ซ ใ‚’ๅˆ†ๅ‰ฒใ—ใพใ™ใ€‚
# ใ€Œไพ‹ใˆใฐใ€‚ใ€ใ“ใฎใ‚ˆใ†ใชใ‚ซใƒƒใ‚ณๅ†…ใฎใƒ†ใ‚ญใ‚นใƒˆใฏๅˆ†ๅ‰ฒใ—ใพใ›ใ‚“ใ€‚

text = "ใ“ใ‚Œใฏใ€Œใƒ†ใ‚นใƒˆใงใ™ใ€‚๏ฝ›ๆ•ดๅˆๆ€งใฎๅ–ใ‚Œใชใ„ใ‚ซใƒƒใ‚ณใฏๆถˆๅŽปใ•ใ‚Œใพใ™ใ€‚๏ผ‰"
out = break_line(text)

print(out)
# ใ“ใ‚Œใฏใƒ†ใ‚นใƒˆใงใ™ใ€‚
# ๆ•ดๅˆๆ€งใฎๅ–ใ‚Œใชใ„ใ‚ซใƒƒใ‚ณใฏๆถˆๅŽปใ•ใ‚Œใพใ™ใ€‚

text = "ใ“ใ‚Œใฏใ€Œใƒ†ใ‚นใƒˆใงใ™ใ€‚๏ฝ›ๆ•ดๅˆๆ€งใฎใชใ„ใ‚ซใƒƒใ‚ณใฏ็„ก่ฆ–ใ•ใ‚Œใพใ™ใ€‚๏ผ‰ๆ”น่กŒใฏใงใใพใ›ใ‚“ใ€‚"
out = break_line(text, ignore_unbalanced=True)

print(out)
# ใ“ใ‚Œใฏใ€Œใƒ†ใ‚นใƒˆใงใ™ใ€‚๏ฝ›ๆ•ดๅˆๆ€งใฎใชใ„ใ‚ซใƒƒใ‚ณใฏ็„ก่ฆ–ใ•ใ‚Œใพใ™ใ€‚๏ผ‰ๆ”น่กŒใฏใงใใพใ›ใ‚“ใ€‚
```