TEXT LANGUAGE TYPE SWITCHING METHOD AND APPARATUS, DEVICE, AND STORAGE MEDIUM
A text language type switching method and apparatus, a device, and a non-transitory computer-readable storage medium are provided. The method includes: receiving a typing input of a user; displaying a first text segment in response to the typing input; receiving a first input of the user; determining a to-be-switched text segment of a first language type from the first text segment in response to the first input; receiving a second input of the user; and switching the to-be-switched text segment to a target text segment of a second language type in response to the second input.
1 . A text language type switching method, comprising:
receiving a typing input of a user;
displaying a first text segment in response to the typing input;
receiving a first input of the user;
determining a to-be-switched text segment of a first language type from the first text segment in response to the first input;
receiving a second input of the user; and
switching the to-be-switched text segment to a target text segment of a second language type in response to the second input.
2 . The text language type switching method according to claim 1 ,
wherein:
the typing input comprises a first typing sub-input,
the displaying a first text segment in response to the typing input comprises:
determining an original text segment according to the first typing sub-input, and determining the to-be-switched text segment of the first language type corresponding to the original text segment, and
the switching the to-be-switched text segment to a target text segment of a second language type comprises:
determining, according to the original text segment corresponding to the to-be-switched text segment, a target text segment of the second language type corresponding to the original text segment.
3 . The text language type switching method according to claim 2 , wherein
in a case that the first language type is English, the to-be-switched text segment is the original text segment; and
in a case that the second language type is English, the target text segment is the original text segment.
4 . The text language type switching method according to claim 2 , wherein in a case that the original text segment corresponds to a text segment of at least one second language type, the determining, according to the original text segment corresponding to the to-be-switched text segment, a target text segment of the second language type corresponding to the original text segment comprises:
displaying the text segment of at least one second language type that matches the original text segment corresponding to the to-be-switched text segment;
receiving a third input of the user; and
determining the target text segment of the second language type from the text segment of at least one second language type in response to the third input.
5 . The text language type switching method according to claim 1 , wherein the first text segment comprises at least two sub-text segments that are sequentially input by the user, and the determining a to-be-switched text segment of a first language type from the first text segment in response to the first input comprises:
determining, according to a target type of the first input, a target sequence number corresponding to the target type, and determining a sub-text segment corresponding to the target sequence number that is in the at least two sub-text segments as the to-be-switched text segment.
6 . The text language type switching method according to claim 5 , further comprising determining the sub-text segment, comprising:
in a case that an input event of acknowledgment text is monitored, determining, as the sub-text segment, text between latest input text and text that is input for the first time after the input event is previously monitored.
7 . The text language type switching method according to claim 1 , wherein the switching the to-be-switched text segment to a target text segment of a second language type in response to the second input comprises:
switching the to-be-switched text segment to a target text segment of the second language type, and switching a cursor to the end of a displayed text segment in response to the second input.
8 . An electronic device, comprising a memory having a computer program stored thereon;
and a processor, wherein the computer program, when executed by the processor, causes the processor to perform a text language type switching method, comprising:
receiving a typing input of a user;
displaying a first text segment in response to the typing input;
receiving a first input of the user;
determining a to-be-switched text segment of a first language type from the first text segment in response to the first input;
receiving a second input of the user; and
switching the to-be-switched text segment to a target text segment of a second language type in response to the second input.
9 . The electronic device according to claim 8 ,
wherein:
the typing input comprises a first typing sub-input,
the displaying a first text segment in response to the typing input comprises:
determining an original text segment according to the first typing sub-input, and determining the to-be-switched text segment of the first language type corresponding to the original text segment, and
the switching the to-be-switched text segment to a target text segment of a second language type comprises:
determining, according to the original text segment corresponding to the to-be-switched text segment, a target text segment of the second language type corresponding to the original text segment.
10 . The electronic device according to claim 9 , wherein
in a case that the first language type is English, the to-be-switched text segment is the original text segment; and
in a case that the second language type is English, the target text segment is the original text segment.
11 . The text language type switching method according to claim 9 , wherein in a case that the original text segment corresponds to a text segment of at least one second language type, the determining, according to the original text segment corresponding to the to-be-switched text segment, a target text segment of the second language type corresponding to the original text segment comprises:
displaying the text segment of at least one second language type that matches the original text segment corresponding to the to-be-switched text segment;
receiving a third input of the user; and
determining the target text segment of the second language type from the text segment of at least one second language type in response to the third input.
12 . The electronic device according to claim 8 , wherein the first text segment comprises at least two sub-text segments that are sequentially input by the user, and the determining a to-be-switched text segment of a first language type from the first text segment in response to the first input comprises:
determining, according to a target type of the first input, a target sequence number corresponding to the target type, and determining a sub-text segment corresponding to the target sequence number that is in the at least two sub-text segments as the to-be-switched text segment.
13 . The electronic device according to claim 12 , wherein the method further comprises determining the sub-text segment, comprising:
in a case that an input event of acknowledgment text is monitored, determining, as the sub-text segment, text between latest input text and text that is input for the first time after the input event is previously monitored.
14 . The electronic device according to claim 8 , wherein the switching the to-be-switched text segment to a target text segment of a second language type in response to the second input comprises:
switching the to-be-switched text segment to a target text segment of the second language type, and switching a cursor to the end of a displayed text segment in response to the second input.
15 . A non-transitory computer-readable storage medium storing a computer program or an instruction that, when executed by a processor, causes the processor to perform a text language type switching method, comprising:
receiving a typing input of a user;
displaying a first text segment in response to the typing input;
receiving a first input of the user;
determining a to-be-switched text segment of a first language type from the first text segment in response to the first input;
receiving a second input of the user; and
switching the to-be-switched text segment to a target text segment of a second language type in response to the second input.
16 . The non-transitory computer-readable storage medium according to claim 15 ,
wherein:
the typing input comprises a first typing sub-input,
the displaying a first text segment in response to the typing input comprises:
determining an original text segment according to the first typing sub-input, and determining the to-be-switched text segment of the first language type corresponding to the original text segment, and
the switching the to-be-switched text segment to a target text segment of a second language type comprises:
determining, according to the original text segment corresponding to the to-be-switched text segment, a target text segment of the second language type corresponding to the original text segment.
17 . The non-transitory computer-readable storage medium according to claim 16 , wherein
in a case that the first language type is English, the to-be-switched text segment is the original text segment; and
in a case that the second language type is English, the target text segment is the original text segment.
18 . The text language type switching method according to claim 16 , wherein in a case that the original text segment corresponds to a text segment of at least one second language type, the determining, according to the original text segment corresponding to the to-be-switched text segment, a target text segment of the second language type corresponding to the original text segment comprises:
displaying the text segment of at least one second language type that matches the original text segment corresponding to the to-be-switched text segment;
receiving a third input of the user; and
determining the target text segment of the second language type from the text segment of at least one second language type in response to the third input.
19 . The non-transitory computer-readable storage medium according to claim 15 , wherein the first text segment comprises at least two sub-text segments that are sequentially input by the user, and the determining a to-be-switched text segment of a first language type from the first text segment in response to the first input comprises:
determining, according to a target type of the first input, a target sequence number corresponding to the target type, and determining a sub-text segment corresponding to the target sequence number that is in the at least two sub-text segments as the to-be-switched text segment.
20 . The non-transitory computer-readable storage medium according to claim 19 , wherein the method further comprises determining the sub-text segment, comprising:
in a case that an input event of acknowledgment text is monitored, determining, as the sub-text segment, text between latest input text and text that is input for the first time after the input event is previously monitored.