PHPackages                             sastrawi/sentence-detector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sastrawi/sentence-detector

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

sastrawi/sentence-detector
==========================

PHP library that detects sentence in Bahasa Indonesia.

v1.1.0(11y ago)134872[1 issues](https://github.com/sastrawi/sentence-detector/issues)MITPHPPHP &gt;=5.3

Since Nov 17Pushed 11y ago3 watchersCompare

[ Source](https://github.com/sastrawi/sentence-detector)[ Packagist](https://packagist.org/packages/sastrawi/sentence-detector)[ Docs](https://github.com/sastrawi/sentence-detector)[ RSS](/packages/sastrawi-sentence-detector/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (5)Versions (9)Used By (0)

Sastrawi Sentence Detector
==========================

[](#sastrawi-sentence-detector)

Sastrawi Sentence Detector adalah library PHP untuk melakukan deteksi kalimat.

DevelopmentMasterReleasesStatistics[![Build Status](https://camo.githubusercontent.com/33f3a7c25c54a790a7db79c27a80674d0f7e175f8b701d10ca9cd762190949b9/68747470733a2f2f7472617669732d63692e6f72672f73617374726177692f73656e74656e63652d6465746563746f722e7376673f6272616e63683d646576656c6f706d656e74)](https://travis-ci.org/sastrawi/sentence-detector) [![Code Coverage](https://camo.githubusercontent.com/620bbd0a7656b309bf2d6cf18b3650d1962b21ad5187cc30f10af54e13558359/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73617374726177692f73656e74656e63652d6465746563746f722f6261646765732f636f7665726167652e706e673f623d646576656c6f706d656e74)](https://scrutinizer-ci.com/g/sastrawi/sentence-detector/?branch=development) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/42b1e6a509593d97e02a2c3446936d94768a40158471cc470f5bdd259c39d180/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73617374726177692f73656e74656e63652d6465746563746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d646576656c6f706d656e74)](https://scrutinizer-ci.com/g/sastrawi/sentence-detector/?branch=development)[![Build Status](https://camo.githubusercontent.com/f3af155c0a6fefa4a5035790da48d7eda15db48039d56925586247d3d775d39b/68747470733a2f2f7472617669732d63692e6f72672f73617374726177692f73656e74656e63652d6465746563746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sastrawi/sentence-detector)[![Latest Stable Version](https://camo.githubusercontent.com/4b7fb588b8e7d3ac03276e37b31f8c5f828b6ab6f915f51dad69f5e679dfebc0/68747470733a2f2f706f7365722e707567782e6f72672f73617374726177692f73656e74656e63652d6465746563746f722f762f737461626c652e706e67)](https://packagist.org/packages/sastrawi/sentence-detector)[![Total Downloads](https://camo.githubusercontent.com/f26c6d618dd4ca084e4841a79ffeafd617debe9b16d91cee95a1c49dada5cfb0/68747470733a2f2f706f7365722e707567782e6f72672f73617374726177692f73656e74656e63652d6465746563746f722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/sastrawi/sentence-detector)Sentence Detector
-----------------

[](#sentence-detector)

Indonesia menempati posisi ke-4 negara berpenduduk terbanyak di dunia. Berdasarkan [sumber](http://www.thejakartapost.com/news/2013/06/18/facebook-has-64m-active-indonesian-users.html), pada 2013 tercatat Lebih dari 64 juta pengguna facebook berasal dari Indonesia.

Dalam aktivitas sehari-hari, pengguna internet di Indonesia menggunakan Bahasa Indonesia sebagai bahasa utama. Oleh sebab itu, para *developer* mulai membutuhkan bantuan software untuk melakukan analisa text dalam Bahasa Indonesia. Salah satu tahap analisa tersebut adalah sentence detection atau sentence segmentation, yaitu memecah text menjadi kalimat-kalimat, contohnya:

```
Saya sedang belajar NLP Bahasa Indonesia. Saya sedang melakukan segmentasi kalimat.

```

Text di atas terdiri dari 2 kalimat, yaitu:

```
- Saya sedang belajar NLP Bahasa Indonesia.
- Saya sedang melakukan segmentasi kalimat.

```

Masih terlihat sederhana, sampai muncul kalimat-kalimat berikut:

```
Saya belajar NLP di Jl. Prof. Dr. Soepomo SH no. 11. Kapan saya harus ke sana?

```

Text di atas terdiri dari 2 kalimat, yaitu:

```
- Saya belajar NLP di Jl. Prof. Dr. Soepomo SH no. 11.
- Kapan saya harus ke sana?

```

Sastrawi Sentence Detector
--------------------------

[](#sastrawi-sentence-detector-1)

- *Library PHP* untuk melakukan *sentence segmentation* pada Bahasa Indonesia.
- Mudah diintegrasikan dengan *framework* / *package* lainnya.
- Mempunyai *API* yang sederhana dan mudah digunakan.
- Terinspirasi oleh Apache OpenNLP.

Demo
----

[](#demo)

Cara Install
------------

[](#cara-install)

Sastrawi Sentence Detector dapat diinstall dengan [Composer](https://getcomposer.org).

1. Buka terminal (command line) dan arahkan ke directory project Anda.
2. [Download Composer](https://getcomposer.org/download/) sehingga file `composer.phar` berada di directory tersebut.
3. Tambahkan Sastrawi Sentence Detector ke file `composer.json` Anda :

```
php composer.phar require sastrawi/sentence-detector:~1
```

Jika Anda masih belum memahami bagaimana cara menggunakan Composer, silahkan baca [Getting Started with Composer](https://getcomposer.org/doc/00-intro.md).

Penggunaan
----------

[](#penggunaan)

Copy kode berikut di directory project anda. Lalu jalankan file tersebut.

```
