-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathtest_data.js
74 lines (71 loc) · 3.03 KB
/
test_data.js
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
73
74
export const generateTestData = (num) => {
const testDataArray = [];
const messagesJa = [
"今日はとてもいい天気ですね。",
"次の会議は何時に始まりますか?",
"新しいプロジェクトについて話しましょう。",
"お疲れ様です。今日は早く帰れますか?",
"この書類にサインをお願いします。",
"次の休暇はどこに行きますか?",
"先週のレポートを見ましたか?",
"この問題をどうやって解決しますか?",
"週末は何をする予定ですか?",
"新しいアイデアを聞かせてください。",
"こんにちは、調子はどうですか?",
"おはようございます、今日の予定は何ですか?",
"こんばんは、今日は楽しかったですか?",
"ありがとう、助かりました。",
"さようなら、また会いましょう。",
"はい、分かりました。",
"いいえ、ちょっと難しいです。",
"すみません、もう一度言ってください。",
"お願いします、手伝ってください。",
"お疲れ様です、今日も頑張りましょう。",
];
const messagesEn = [
"The weather is very nice today.",
"What time does the next meeting start?",
"Let's talk about the new project.",
"Good job today. Can you leave early today?",
"Please sign this document.",
"Where are you going for the next vacation?",
"Did you see last week's report?",
"How do we solve this problem?",
"What are your plans for the weekend?",
"Tell me about your new idea.",
"Hello, how are you?",
"Good morning, what are your plans for today?",
"Good evening, did you have a good day?",
"Thank you, that was helpful.",
"Goodbye, see you again.",
"Yes, understood.",
"No, it's a bit difficult.",
"Sorry, could you say that again?",
"Please, help me out.",
"Good job today, let's do our best again tomorrow.",
];
const statuses = ["sent", "received"];
for (let i = 0; i < num; i++) {
const uuid = crypto.randomUUID();
const date = new Date().toLocaleTimeString(
"ja-JP",
{ hour12: false, hour: "2-digit", minute: "2-digit" }
);
const messageIndex = Math.floor(Math.random() * messagesJa.length);
const status = statuses[Math.floor(Math.random() * statuses.length)];
const testData = {
id: uuid,
category: status,
status: status,
created_at: date,
messages: {
original: messagesJa[messageIndex],
translated: [
messagesEn[messageIndex],
],
},
};
testDataArray.push(testData);
}
return testDataArray;
};