https://github.com/olekscode/manualclassifier
https://github.com/olekscode/manualclassifier
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/olekscode/manualclassifier
- Owner: olekscode
- License: mit
- Created: 2020-04-18T00:25:02.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-06T22:14:10.000Z (almost 4 years ago)
- Last Synced: 2025-02-11T11:41:44.065Z (5 months ago)
- Language: Smalltalk
- Size: 19.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ManualClassifier
## How to install it?
To install `ManualClassifier`, go to the Playground (Ctrl+OW) in your [Pharo](https://pharo.org/) image and execute the following Metacello script (select it and press Do-it button or Ctrl+D):
```Smalltalk
Metacello new
baseline: 'ManualClassifier';
repository: 'github://olekscode/ManualClassifier/src';
load.
```## How to depend on it?
If you want to add a dependency on `ManualClassifier` to your project, include the following lines into your baseline method:
```Smalltalk
spec
baseline: 'ManualClassifier'
with: [ spec repository: 'github://olekscode/ManualClassifier/src' ].
```If you are new to baselines and Metacello, check out the [Baselines](https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/Baselines.md) tutorial on Pharo Wiki.
## How to use it?
```Smalltalk
category := 'Numbers' ~ [ :object | object isNumber ] -> {
'Positive' ~ [ :number | number > 0 ] -> {
'Even' ~ [ :number | number % 2 = 0 ] .
'Odd' ~ [ :number | number % 2 = 1 ] } .
'Negative' ~ [ :number | number < 0 ] .
'Zero' ~ [ :number | number = 0 ] }.
numbers := (1 to: 10) collect: [ :i | (1 to: 100) atRandom - 50 ].(category accept: numbers) inspect.
```