Added Classes

This commit is contained in:
Silas Vedder 2022-08-20 00:16:15 +02:00
parent 7edbf5f0dd
commit d9431d73c1
4 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,11 @@
Class {
#name : #BaselineOfBemblin,
#superclass : #BaselineOf,
#category : #BaselineOfBemblin
}
{ #category : #accessing }
BaselineOfBemblin >> baseline: spec [
<baseline>
spec for: #common do: [ spec package: 'Bemblin' ]
]

View File

@ -0,0 +1 @@
Package { #name : #BaselineOfBemblin }

View File

@ -0,0 +1,35 @@
Class {
#name : #BemblinDict,
#superclass : #Object,
#instVars : [
'host',
'port',
'word'
],
#category : #Bemblin
}
{ #category : #accessing }
BemblinDict >> getWord: aString [
| json |
json := ZnClient new
get: 'https://' , host , ':' , port asString , '/Word/' , aString.
word := STON fromString: json
]
{ #category : #accessing }
BemblinDict >> viewWord: aView [
<gtView>
^ aView columnedList
title: 'Word';
priority: 1;
items: [ {word} ];
column: 'Word' text: [:w | w at: 'word' ];
column: 'Translation' text: [:w | w at: 'translation' ].
]
{ #category : #accessing }
BemblinDict >> withHost: aString andPort: anInteger [
host := aString.
port := anInteger
]

1
src/Bemblin/package.st Normal file
View File

@ -0,0 +1 @@
Package { #name : #Bemblin }