forked from googleapis/python-language
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalyzing_syntax.test.yaml
72 lines (68 loc) · 2.66 KB
/
analyzing_syntax.test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
type: test/samples
schema_version: 1
test:
suites:
- name: "Analyzing Syntax [code sample tests]"
cases:
- name: language_syntax_text - Analyzing the syntax of a text string (default value)
spec:
# Default value: "This is a short sentence."
- call: {sample: language_syntax_text}
- assert_contains:
- {literal: "Token text: is"}
- {literal: "Part of Speech tag: VERB"}
- {literal: "Tense: PRESENT"}
- {literal: "Lemma: be"}
- {literal: "Token text: short"}
- {literal: "Part of Speech tag: ADJ"}
- {literal: "Lemma: short"}
- {literal: "Language of the text: en"}
- name: language_syntax_text - Analyzing the syntax of a text string (*custom value*)
spec:
# Custom value: "Alice runs. Bob ran."
- call:
sample: language_syntax_text
params:
text_content: {literal: "Alice runs. Bob ran."}
- assert_contains:
- {literal: "Token text: Alice"}
- {literal: "Location of this token in overall document: 0"}
- {literal: "Part of Speech tag: NOUN"}
- {literal: "Label: NSUBJ"}
- {literal: "Token text: runs"}
- {literal: "Part of Speech tag: VERB"}
- {literal: "Tense: PRESENT"}
- {literal: "Lemma: run"}
- {literal: "Token text: ran"}
- {literal: "Tense: PAST"}
- {literal: "Language of the text: en"}
- name: language_syntax_gcs - Analyzing the syntax of text file in GCS (default value)
spec:
# Default value: gs://cloud-samples-data/language/syntax-sentence.txt
# => "This is a short sentence."
- call: {sample: language_syntax_gcs}
- assert_contains:
- {literal: "Token text: is"}
- {literal: "Part of Speech tag: VERB"}
- {literal: "Tense: PRESENT"}
- {literal: "Lemma: be"}
- {literal: "Token text: short"}
- {literal: "Part of Speech tag: ADJ"}
- {literal: "Lemma: short"}
- {literal: "Language of the text: en"}
- name: language_syntax_gcs - Analyzing the syntax of text file in GCS (*custom value*)
spec:
# Use different file: gs://cloud-samples-data/language/hello.txt
# => "Hello, world!"
- call:
sample: language_syntax_gcs
params:
gcs_content_uri:
literal: "gs://cloud-samples-data/language/hello.txt"
- assert_contains:
- {literal: "Token text: Hello"}
- {literal: "Token text: World"}
- {literal: "Part of Speech tag: NOUN"}
- {literal: "Token text: !"}
- {literal: "Part of Speech tag: PUNCT"}
- {literal: "Language of the text: en"}