@sefinek/google-tts-api 2.1.12 → 2.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sefinek/google-tts-api",
3
- "version": "2.1.12",
3
+ "version": "2.1.13",
4
4
  "description": "Fast Google TTS (Text-To-Speech) for Node.js. For free without any API keys!",
5
5
  "keywords": [
6
6
  "cloud",
@@ -32,6 +32,12 @@
32
32
  "example": "example",
33
33
  "test": "test"
34
34
  },
35
+ "files": [
36
+ "dist",
37
+ "example",
38
+ "LICENSE",
39
+ "README.md"
40
+ ],
35
41
  "scripts": {
36
42
  "build": "tsc -p .",
37
43
  "cover": "npm run build && jest --coverage",
package/eslint.config.mjs DELETED
@@ -1,55 +0,0 @@
1
- import js from '@eslint/js';
2
- import globals from 'globals';
3
-
4
- export default [
5
- js.configs.recommended,
6
- {
7
- languageOptions: {
8
- ecmaVersion: 'latest',
9
- globals: {
10
- ...globals.node,
11
- ...globals.jest,
12
- },
13
- },
14
- rules: {
15
- 'arrow-spacing': ['warn', { before: true, after: true }],
16
- 'comma-dangle': ['warn', { arrays: 'always-multiline', objects: 'always-multiline' }],
17
- 'comma-spacing': 'warn',
18
- 'comma-style': 'error',
19
- 'curly': ['error', 'multi-line', 'consistent'],
20
- 'dot-location': ['error', 'property'],
21
- 'handle-callback-err': 'off',
22
- 'indent': ['warn', 'tab'],
23
- 'keyword-spacing': 'warn',
24
- 'max-nested-callbacks': ['error', { max: 4 }],
25
- 'max-statements-per-line': ['error', { max: 2 }],
26
- 'no-console': 'off',
27
- 'no-empty': 'warn',
28
- 'no-empty-function': 'warn',
29
- 'no-floating-decimal': 'error',
30
- 'no-lonely-if': 'warn',
31
- 'no-multi-spaces': 'warn',
32
- 'no-multiple-empty-lines': ['warn', { max: 3, maxEOF: 1, maxBOF: 0 }],
33
- 'no-shadow': ['error', { allow: ['err', 'resolve', 'reject'] }],
34
- 'no-trailing-spaces': 'warn',
35
- 'no-unreachable': 'warn',
36
- 'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
37
- 'no-use-before-define': ['error', { functions: false, classes: true }],
38
- 'no-var': 'error',
39
- 'object-curly-spacing': ['warn', 'always'],
40
- 'prefer-const': 'error',
41
- 'quotes': ['warn', 'single'],
42
- 'semi': ['warn', 'always'],
43
- 'sort-vars': 'warn',
44
- 'space-before-blocks': 'warn',
45
- 'space-before-function-paren': ['warn', { anonymous: 'never', named: 'never', asyncArrow: 'always' }],
46
- 'space-in-parens': 'warn',
47
- 'space-infix-ops': 'warn',
48
- 'space-unary-ops': 'warn',
49
- 'spaced-comment': 'warn',
50
- 'wrap-regex': 'warn',
51
- 'yoda': 'error',
52
- },
53
- ignores: ['node_modules', '**/*.min.js', '**/*bundle*', 'build/**', 'dist/**', 'services/translations/**'],
54
- },
55
- ];
@@ -1,29 +0,0 @@
1
- const axios = require('axios');
2
- const isBase64 = require('is-base64');
3
- const googleTTS = require('../dist/index');
4
- jest.setTimeout(60000);
5
-
6
- const TestCases = [
7
- ['Hello'],
8
- ['hello world', { lang: 'en' }],
9
- ['hello world', { slow: false }],
10
- ['hello world', { host: 'https://translate.google.pl' }],
11
- ['你好', { lang: 'zh' }],
12
- ['你好世界', { lang: 'zh' }],
13
- ['123', { lang: 'en', slow: true }],
14
- ['123', { lang: 'zh', slow: true }]
15
- ];
16
-
17
- test('get TTS URL', async () => {
18
- for (const [text, options] of TestCases) {
19
- const url = googleTTS.getAudioUrl(text, options);
20
- await axios.get(url);
21
- }
22
- });
23
-
24
- test('get TTS Base64 Text', async () => {
25
- for (const [text, options] of TestCases) {
26
- const base64 = await googleTTS.getAudioBase64(text, options);
27
- expect(isBase64(base64)).toBe(true);
28
- }
29
- });
@@ -1,187 +0,0 @@
1
- const axios = require('axios');
2
- const isBase64 = require('is-base64');
3
- const googleTTS = require('../dist/index');
4
- jest.setTimeout(60000);
5
-
6
- describe('Long Text', () => {
7
- it('English: 180 characters', async () => {
8
- const text =
9
- 'The Industrial Revolution had several roots, one of which was a commercial revolution that, beginnin' +
10
- 'g as far back as the sixteenth century, accompanied Europe’s expansion overseas.';
11
-
12
- // 1. audio URL
13
- const url = googleTTS.getAudioUrl(text);
14
- await axios.get(url);
15
-
16
- // 2. all audio URLs
17
- let resultList = googleTTS.getAllAudioUrls(text);
18
- expect(resultList.length).toBe(1);
19
- expect(resultList).toStrictEqual([{ shortText: text, url }]);
20
-
21
- // 3. audio base64
22
- const base64 = await googleTTS.getAudioBase64(text);
23
- expect(isBase64(base64)).toBe(true);
24
-
25
- // 4. all audio base64
26
- resultList = await googleTTS.getAllAudioBase64(text);
27
- expect(resultList.length).toBe(1);
28
-
29
- const firstResult = resultList[0];
30
- expect(firstResult.shortText).toBe(text);
31
- expect(isBase64(firstResult.base64)).toBe(true);
32
- });
33
-
34
- it('English: 200 characters', async () => {
35
- const text =
36
- 'The Industrial Revolution had several roots, one of which was a commercial revolution that, beginnin' +
37
- 'g as far back as the sixteenth century, accompanied Europe’s expansion overseas. exports and imports';
38
-
39
- // 1. audio URL
40
- const url = googleTTS.getAudioUrl(text);
41
- await axios.get(url);
42
-
43
- // 2. all audio URLs
44
- let resultList = googleTTS.getAllAudioUrls(text);
45
- expect(resultList.length).toBe(1);
46
- expect(resultList).toStrictEqual([{ shortText: text, url }]);
47
-
48
- // 3. audio base64
49
- const base64 = await googleTTS.getAudioBase64(text);
50
- expect(isBase64(base64)).toBe(true);
51
-
52
- // 4. all audio base64
53
- resultList = await googleTTS.getAllAudioBase64(text);
54
- expect(resultList.length).toBe(1);
55
-
56
- const firstResult = resultList[0];
57
- expect(firstResult.shortText).toBe(text);
58
- expect(isBase64(firstResult.base64)).toBe(true);
59
- });
60
-
61
- it('English: 268 characters', async () => {
62
- const errorMessage = 'should be less than 200 characters';
63
- const text =
64
- 'The Industrial Revolution had several roots, one of which was a commercial revolution that, beginnin' +
65
- 'g as far back as the sixteenth century, accompanied Europe’s expansion overseas. Both exports and im' +
66
- 'ports showed spectacular growth, particularly in England and France.';
67
-
68
- // 1. audio URL
69
- expect(() => {
70
- googleTTS.getAudioUrl(text);
71
- }).toThrow(errorMessage);
72
-
73
- // 2. all audio URLs
74
- let resultList = googleTTS.getAllAudioUrls(text);
75
- expect(resultList.length).toBe(2);
76
- expect(resultList.map((item) => item.shortText).join('')).toBe(text);
77
- await Promise.all(resultList.map(({ url }) => axios.get(url)));
78
-
79
- // 3. audio base64
80
- await expect(() => {
81
- return googleTTS.getAudioBase64(text);
82
- }).rejects.toThrow(errorMessage);
83
-
84
- // 4. all audio base64
85
- resultList = await googleTTS.getAllAudioBase64(text);
86
- expect(resultList.length).toBe(2);
87
- expect(resultList.map((item) => item.shortText).join('')).toBe(text);
88
- for (const { base64 } of resultList) {
89
- expect(isBase64(base64)).toBe(true);
90
- }
91
- });
92
-
93
- it('Chinese: 193 characters', async () => {
94
- const option = { lang: 'zh' };
95
- const text =
96
- '如果想想生物在死之后被完全摧毁的种种方式,能够这样频繁出现化石是一件很令人惊讶的事。食腐动物和细菌的' +
97
- '破坏、化学性腐烂、腐蚀以及其它地质因素都会非常不利于保存。不过,如果生物体碰巧具有矿化的骨骼并且死于' +
98
- '可以迅速被沉积物掩埋的地方,摆脱被完全摧毁的几率便会大大增加。海底通常就具有上述的两方面条件,这里生' +
99
- '活着很多带壳的无脊椎动物(没有脊椎的动物),不断累积的似雨的沉积颗粒会把它们掩埋起来。';
100
-
101
- // 1. audio URL
102
- const url = googleTTS.getAudioUrl(text, option);
103
- await axios.get(url);
104
-
105
- // 2. all audio URLs
106
- let resultList = googleTTS.getAllAudioUrls(text, option);
107
- expect(resultList.length).toBe(1);
108
- expect(resultList).toStrictEqual([{ shortText: text, url }]);
109
-
110
- // 3. audio base64
111
- const base64 = await googleTTS.getAudioBase64(text, option);
112
- expect(isBase64(base64)).toBe(true);
113
-
114
- // 4. all audio base64
115
- resultList = await googleTTS.getAllAudioBase64(text, option);
116
- expect(resultList.length).toBe(1);
117
-
118
- const firstResult = resultList[0];
119
- expect(firstResult.shortText).toBe(text);
120
- expect(isBase64(firstResult.base64)).toBe(true);
121
- });
122
-
123
- it('Chinese: 200 characters', async () => {
124
- const option = { lang: 'zh' };
125
- const text =
126
- '如果想想生物在死之后被完全摧毁的种种方式,能够这样频繁出现化石是一件很令人惊讶的事。食腐动物和细菌的' +
127
- '破坏、化学性腐烂、腐蚀以及其它地质因素都会非常不利于保存。不过,如果生物体碰巧具有矿化的骨骼并且死于' +
128
- '可以迅速被沉积物掩埋的地方,摆脱被完全摧毁的几率便会大大增加。海底通常就具有上述的两方面条件,这里生' +
129
- '活着很多带壳的无脊椎动物(没有脊椎的动物),不断累积的似雨的沉积颗粒会把它们掩埋起来。虽然多数的化石';
130
-
131
- // 1. audio URL
132
- const url = googleTTS.getAudioUrl(text, option);
133
- await axios.get(url);
134
-
135
- // 2. all audio URLs
136
- let resultList = googleTTS.getAllAudioUrls(text, option);
137
- expect(resultList.length).toBe(1);
138
- expect(resultList).toStrictEqual([{ shortText: text, url }]);
139
-
140
- // 3. audio base64
141
- const base64 = await googleTTS.getAudioBase64(text, option);
142
- expect(isBase64(base64)).toBe(true);
143
-
144
- // 4. all audio base64
145
- resultList = await googleTTS.getAllAudioBase64(text, option);
146
- expect(resultList.length).toBe(1);
147
-
148
- const firstResult = resultList[0];
149
- expect(firstResult.shortText).toBe(text);
150
- expect(isBase64(firstResult.base64)).toBe(true);
151
- });
152
-
153
- it('Chinese: 211 characters', async () => {
154
- const errorMessage = 'should be less than 200 characters';
155
- const option = { lang: 'zh', splitPunct: ',、。()' };
156
- const text =
157
- '如果想想生物在死之后被完全摧毁的种种方式,能够这样频繁出现化石是一件很令人惊讶的事。食腐动物和细菌的' +
158
- '破坏、化学性腐烂、腐蚀以及其它地质因素都会非常不利于保存。不过,如果生物体碰巧具有矿化的骨骼并且死于' +
159
- '可以迅速被沉积物掩埋的地方,摆脱被完全摧毁的几率便会大大增加。海底通常就具有上述的两方面条件,这里生' +
160
- '活着很多带壳的无脊椎动物(没有脊椎的动物),不断累积的似雨的沉积颗粒会把它们掩埋起来。虽然多数的化石' +
161
- '是在海洋沉积岩中发现的';
162
-
163
- // 1. audio URL
164
- expect(() => {
165
- googleTTS.getAudioUrl(text, option);
166
- }).toThrow(errorMessage);
167
-
168
- // 2. all audio URLs
169
- let resultList = googleTTS.getAllAudioUrls(text, option);
170
- expect(resultList.length).toBe(2);
171
- expect(resultList.map((item) => item.shortText).join('')).toBe(text);
172
- await Promise.all(resultList.map(({ url }) => axios.get(url)));
173
-
174
- // 3. audio base64
175
- await expect(() => {
176
- return googleTTS.getAudioBase64(text, option);
177
- }).rejects.toThrow(errorMessage);
178
-
179
- // 4. all audio base64
180
- resultList = await googleTTS.getAllAudioBase64(text, option);
181
- expect(resultList.length).toBe(2);
182
- expect(resultList.map((item) => item.shortText).join('')).toBe(text);
183
- for (const { base64 } of resultList) {
184
- expect(isBase64(base64)).toBe(true);
185
- }
186
- });
187
- });
@@ -1,65 +0,0 @@
1
- const googleTTS = require('../dist/index');
2
-
3
- const TestCases = [
4
- [null, {}, 'text should be a string'],
5
- ['', {}, 'text should be a string'],
6
- [123, {}, 'text should be a string'],
7
- ['test', { lang: null }, 'lang should be a string'],
8
- ['test', { lang: '' }, 'lang should be a string'],
9
- ['test', { lang: 123 }, 'lang should be a string'],
10
- ['test', { slow: null }, 'slow should be a boolean'],
11
- ['test', { slow: 123 }, 'slow should be a boolean'],
12
- ['test', { host: null }, 'host should be a string'],
13
- ['test', { host: '' }, 'host should be a string']
14
- ];
15
-
16
- test('test paramater for TTS URL', async () => {
17
- for (const [text, option, errorMessage] of TestCases) {
18
- // 1. audio url
19
- expect(() => {
20
- googleTTS.getAudioUrl(text, option);
21
- }).toThrow(errorMessage);
22
-
23
- // 2. all audio url
24
- expect(() => {
25
- googleTTS.getAllAudioUrls(text, option);
26
- }).toThrow(errorMessage);
27
- }
28
- });
29
-
30
- test('test paramater for TTS base64', async () => {
31
- const Base64TestCases = [
32
- ...TestCases,
33
- ['test', { timeout: null }, 'timeout should be a positive number'],
34
- ['test', { timeout: -10 }, 'timeout should be a positive number'],
35
- ['test', { timeout: 10 }, 'timeout of 10ms exceeded'],
36
- ['test', { lang: 'DOG-LANG' }, 'lang "DOG-LANG" might not exist']
37
- ];
38
-
39
- for (const [text, option, errorMessage] of Base64TestCases) {
40
- // 1. audio base64
41
- await expect(() => {
42
- return googleTTS.getAudioBase64(text, option);
43
- }).rejects.toThrow(errorMessage);
44
-
45
- // 2. all audio base64
46
- await expect(() => {
47
- return googleTTS.getAllAudioBase64(text, option);
48
- }).rejects.toThrow(errorMessage);
49
- }
50
- });
51
-
52
- test('test splitPunct option for all URL and all base64', async () => {
53
- const option = { splitPunct: null };
54
- const errorMessage = 'splitPunct should be a string';
55
-
56
- // 1. all audio url
57
- expect(() => {
58
- googleTTS.getAllAudioUrls('test', option);
59
- }).toThrow(errorMessage);
60
-
61
- // 2. all audio base64
62
- await expect(() => {
63
- return googleTTS.getAllAudioBase64('test', option);
64
- }).rejects.toThrow(errorMessage);
65
- });
@@ -1,50 +0,0 @@
1
- const axios = require('axios');
2
- const googleTTS = require('../dist/index');
3
-
4
- jest.mock('axios');
5
-
6
- describe('parse base64 text', () => {
7
- it('HTTP request failed', async () => {
8
- axios.mockRejectedValue(new Error('Network Error'));
9
-
10
- await expect(() => {
11
- return googleTTS.getAudioBase64('test');
12
- }).rejects.toThrow('Network Error');
13
- });
14
-
15
- it('parse failed (Part 1)', async () => {
16
- axios.mockResolvedValue({ data: 'UNEXPECT RETURN VALUE' });
17
-
18
- await expect(() => {
19
- return googleTTS.getAudioBase64('test');
20
- }).rejects.toThrow('parse response failed');
21
- });
22
-
23
- it('parse failed (Part 2)', async () => {
24
- const data = `)]}'
25
-
26
- [["wrb.fr","jQ1olc","UNEXPECT VALUE",null,null,null,"generic"]
27
- ,["di",27]
28
- ,["af.httprm",27,"3172555329265361983",8]
29
- ]`;
30
- axios.mockResolvedValue({ data });
31
-
32
- await expect(() => {
33
- return googleTTS.getAudioBase64('test');
34
- }).rejects.toThrow('parse response failed');
35
- });
36
-
37
- it('language does not exist', async () => {
38
- const data = `)]}'
39
-
40
- [["wrb.fr","jQ1olc",null,null,null,null,"generic"]
41
- ,["di",27]
42
- ,["af.httprm",27,"3172555329265361983",8]
43
- ]`;
44
- axios.mockResolvedValue({ data });
45
-
46
- await expect(() => {
47
- return googleTTS.getAudioBase64('test', { lang: 'CAT-LANG' });
48
- }).rejects.toThrow('lang "CAT-LANG" might not exist');
49
- });
50
- });
@@ -1,84 +0,0 @@
1
- const splitLongText = require('../dist/splitLongText').default;
2
-
3
- const longArticle = `The Industrial Revolution had several roots, one of which was a commercial revolution that, beginning as far back as the sixteenth century, accompanied Europe’s expansion overseas.
4
- Both exports and imports showed spectacular growth, particularly in England and France.
5
- An increasingly larger portion of the stepped-up commercial activity was the result of trade with overseas colonies.
6
- Imports included a variety of new beverages, spices, and ship’s goods around the world and brought money flowing back.
7
- Europe’s economic institutions, particularly those in England, were strong, had wealth available for new investment, and seemed almost to be waiting for some technological breakthrough that would expand their profit-making potential even more.
8
-
9
- The breakthrough came in Great Britain, where several economic advantages created a climate especially favorable to the encouragement of new technology.
10
- One was its geographic location at the crossroads of international trade.
11
- Internally, Britain was endowed with easily navigable natural waterway, which helped its trade and communication with the world.
12
- Beginning in the 1770’s, it enjoyed a boom in canal building, which helped make its domestic market more accessible.
13
- Because water transportation was the cheapest means of carrying goods to market, canals reduced prices and thus increased consumer demand.
14
- Great Britain also had rich deposits of coal that fed the factories springing up in industrial and consumer goods.
15
-
16
- Another advantage was Britain’s large population of rural, agricultural wage earners,as well as cottage workers, who had the potential of being more mobile than peasants of some other countries.
17
- Eventually they found their way to the cities or mining communities and provided the human power upon which the Industrial Revolution was built.
18
- The British people were also consumers; the absence of internal tariffs, such as those that existed in France or Italy or between the German states, made Britain the largest free-trade area in Europe.
19
- Britain’s relatively stable government also helped create an atmosphere conducive to industrial progress.
20
-
21
- Great Britain’s better-developed banking and credit system also helped speed the industrial progress, as did the fact that it was the home of an impressive array of entrepreneurs and inventors.
22
- Among them were a large number of nonconformists whose religious principles encouraged thrift and industry rather than luxurious living and who tended to pour their profits back into their business, thus providing the basis for continued expansion.
23
-
24
- A precursor to the Industrial Revolution was a revolution in agricultural techniques.
25
- Ideas about agricultural reform developed first in Holland, where as early as the mid-seventeenth century, such modern methods as crop rotation, heavy fertilization, and diversification were all in use.
26
- Dutch peasant farmers were known throughout Europe for their agricultural innovations, but as British markets and opportunities grew, the English quickly learned from them.
27
- As early as the seventeenth century the Dutch were helping them drain marshes and fens where, with the help of advanced techniques, they grew new crops.
28
- By the mid-eighteenth century new agricultural methods as well as selective breeding of livestock had caught on throughout the country.
29
-
30
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
31
-
32
- Much of the increased production was consumed by Great Britain’s burgeoning population.
33
- At the same time, people were moving to the city, partly because of the enclosure movement; that is, the fencing of common fields and pastures in order to provide more compact, efficient privately held agricultural parcels that would produce more goods and greater profits.
34
- In the sixteenth century enclosures were usually used for creating sheep pastures, but by the eighteenth century new farming techniques made it advantageous for large landowners to seek enclosures in order to improve agricultural production.
35
- Between 1714 and 1820 over 6 million acres of English land were enclosed.
36
- As a result, many small, independent farmers were forced to sell out simply because they could not compete.
37
- Non-landholding peasants and cottage workers, who worked for wages and grazed cows or pigs on the village common, were also hurt when the common was no longer available.
38
- It was such people who began to flock to the cities seeking employment and who found work in the factories that would transform the nation and, the world.
39
-
40
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`;
41
-
42
- const text200 =
43
- 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
44
- 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
45
- 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
46
- 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
47
-
48
- describe('Split long text', () => {
49
- it('each the length of short text should shorter than 200', () => {
50
- const results = splitLongText(longArticle);
51
- for (const str of results) {
52
- expect(str.length <= 200).toBe(true);
53
- }
54
- });
55
-
56
- it('the single word with 200 length', () => {
57
- expect(splitLongText(text200)).toStrictEqual([text200]);
58
- });
59
-
60
- it('the single word is too long to split into short text', () => {
61
- expect(() => splitLongText(text200, { maxLength: 100 })).toThrow(
62
- 'The word is too long to split into a short text:'
63
- );
64
- });
65
-
66
- it('split long chinese text into short text', () => {
67
- const longChineseText =
68
- '如果想想生物在死之后被完全摧毁的种种方式,能够这样频繁出现化石是一件很令人惊讶的事。食腐动物和细菌的' +
69
- '破坏、化学性腐烂、腐蚀以及其它地质因素都会非常不利于保存。不过,如果生物体碰巧具有矿化的骨骼并且死于' +
70
- '可以迅速被沉积物掩埋的地方,摆脱被完全摧毁的几率便会大大增加。海底通常就具有上述的两方面条件,这里生' +
71
- '活着很多带壳的无脊椎动物(没有脊椎的动物),不断累积的似雨的沉积颗粒会把它们掩埋起来。虽然多数的化石' +
72
- '是在海洋沉积岩中发现的';
73
-
74
- // no additional split punctuation
75
- expect(() => splitLongText(longChineseText)).toThrow(
76
- 'The word is too long to split into a short text:'
77
- );
78
-
79
- // add additional split punctuation
80
- const results = splitLongText(longChineseText, { splitPunct: ',、。()' });
81
- expect(results.length).toBe(2);
82
- expect(results[1]).toBe('虽然多数的化石是在海洋沉积岩中发现的');
83
- });
84
- });