Skip to content

Commit a1ffed3

Browse files
committed
Adding licensed field to SupportedLanguage and SupportedLanguagePair WS-1805
1 parent 3d21b17 commit a1ffed3

File tree

6 files changed

+35
-7
lines changed

6 files changed

+35
-7
lines changed

api/src/test/java/com/basistech/rosette/api/BasicTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,12 @@ public void testLanguageSupport() throws Exception {
244244
assertTrue(resp.getSupportedLanguages().contains(SupportedLanguage.builder()
245245
.language(LanguageCode.ENGLISH)
246246
.script(ISO15924.Latn)
247+
.licensed(Boolean.TRUE)
247248
.build()));
248249
assertTrue(resp.getSupportedLanguages().contains(SupportedLanguage.builder()
249250
.language(LanguageCode.JAPANESE)
250251
.script(ISO15924.Kana)
252+
.licensed(Boolean.FALSE)
251253
.build()));
252254
}
253255
}
@@ -272,10 +274,12 @@ public void testNameSimilarityLanguageSupport() throws Exception {
272274
assertTrue(resp.getSupportedLanguagePairs().contains(SupportedLanguagePair.builder()
273275
.source(new TextDomain(ISO15924.Latn, LanguageCode.ENGLISH, null))
274276
.target(new TextDomain(ISO15924.Latn, LanguageCode.ENGLISH, null))
277+
.licensed(Boolean.TRUE)
275278
.build()));
276279
assertTrue(resp.getSupportedLanguagePairs().contains(SupportedLanguagePair.builder()
277280
.source(new TextDomain(ISO15924.Arab, LanguageCode.ARABIC, null))
278281
.target(new TextDomain(ISO15924.Arab, LanguageCode.ARABIC, null))
282+
.licensed(Boolean.TRUE)
279283
.build()));
280284
}
281285
}
@@ -300,10 +304,12 @@ public void testNameTranslationLanguageSupport() throws Exception {
300304
assertTrue(resp.getSupportedLanguagePairs().contains(SupportedLanguagePair.builder()
301305
.source(new TextDomain(ISO15924.Latn, LanguageCode.ENGLISH, TransliterationScheme.NATIVE))
302306
.target(new TextDomain(ISO15924.Latn, LanguageCode.ENGLISH, TransliterationScheme.IC))
307+
.licensed(Boolean.TRUE)
303308
.build()));
304309
assertTrue(resp.getSupportedLanguagePairs().contains(SupportedLanguagePair.builder()
305310
.source(new TextDomain(ISO15924.Arab, LanguageCode.ARABIC, TransliterationScheme.NATIVE))
306311
.target(new TextDomain(ISO15924.Arab, LanguageCode.ARABIC, TransliterationScheme.NATIVE))
312+
.licensed(Boolean.TRUE)
307313
.build()));
308314
}
309315
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"supportedLanguagePairs": [
3-
{"source": {"language": "eng", "script": "Latn"}, "target": {"language": "eng", "script": "Latn"}},
4-
{"source": {"language": "ara", "script": "Arab"}, "target": {"language": "ara", "script": "Arab"}}
3+
{"source": {"language": "eng", "script": "Latn"}, "target": {"language": "eng", "script": "Latn"}, "licensed" : true },
4+
{"source": {"language": "ara", "script": "Arab"}, "target": {"language": "ara", "script": "Arab"}, "licensed" : true }
55
]
66
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"supportedLanguagePairs": [
3-
{"source": {"language": "eng", "script": "Latn", "transliterationScheme": "NATIVE"}, "target": {"language": "eng", "script": "Latn", "transliterationScheme": "IC"}},
4-
{"source": {"language": "ara", "script": "Arab", "transliterationScheme": "NATIVE"}, "target": {"language": "ara", "script": "Arab", "transliterationScheme": "NATIVE"}}
3+
{"source": {"language": "eng", "script": "Latn", "transliterationScheme": "NATIVE"}, "target": {"language": "eng", "script": "Latn", "transliterationScheme": "IC"},
4+
"licensed" : true },
5+
{"source": {"language": "ara", "script": "Arab", "transliterationScheme": "NATIVE"}, "target": {"language": "ara", "script": "Arab", "transliterationScheme": "NATIVE"}, "licensed": true }
56
]
67
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"supportedLanguages": [
3-
{"language": "eng", "script": "Latn"},
4-
{"language": "jpn", "script": "Kana"}
3+
{"language": "eng", "script": "Latn", "licensed" : true },
4+
{"language": "jpn", "script": "Kana", "licensed" : false}
55
]
66
}

model/src/main/java/com/basistech/rosette/apimodel/SupportedLanguage.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
import com.basistech.util.ISO15924;
2121
import com.basistech.util.LanguageCode;
2222
import lombok.Builder;
23+
import lombok.Getter;
24+
import lombok.Setter;
2325
import lombok.Value;
26+
import lombok.experimental.NonFinal;
2427

2528
/**
2629
* Supported language/script
@@ -38,4 +41,12 @@ public class SupportedLanguage {
3841
* @return the script code
3942
*/
4043
private final ISO15924 script;
44+
45+
/**
46+
* @return if this language is licensed or not
47+
*/
48+
@NonFinal
49+
@Getter
50+
@Setter
51+
private Boolean licensed;
4152
}

model/src/main/java/com/basistech/rosette/apimodel/SupportedLanguagePair.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818

1919
import com.basistech.rosette.annotations.JacksonMixin;
2020
import com.basistech.util.TextDomain;
21-
2221
import lombok.Builder;
22+
import lombok.Getter;
23+
import lombok.Setter;
2324
import lombok.Value;
25+
import lombok.experimental.NonFinal;
2426

2527
/**
2628
* Supported language/script/scheme pairs
@@ -38,4 +40,12 @@ public class SupportedLanguagePair {
3840
* @return the target TextDomain
3941
*/
4042
private final TextDomain target;
43+
44+
/**
45+
* @return if this language pair is licensed or not
46+
*/
47+
@NonFinal
48+
@Getter
49+
@Setter
50+
private Boolean licensed;
4151
}

0 commit comments

Comments
 (0)