-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
253 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"id":"chatcmpl-73JoAf0rMfuEnKjayuVg0BBqWb18O","object":"chat.completion","created":1681025482,"model":"gpt-3.5-turbo-0301","usage":{"prompt_tokens":23,"completion_tokens":234,"total_tokens":257},"choices":[{"message":{"role":"assistant","content":"As an AI language model, I cannot display characters in a visual format as they are shown in a computer. However, I can list the characters included in the Greek Code Page 737:Α,Β,Γ,Δ,Ε,Ζ,Η,Θ,Ι,Κ,Λ,Μ,Ν,Ξ,Ο,Π,Ρ,Σ,Τ,Υ,Φ,Χ,Ψ,Ω,α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ,ν,ξ,ο,π,ρ,σ,ς,τ,υ,φ,χ,ψ,░,▒,▓,│,┤,╡,╢,╖,╕,╣,║,╗,╝,╜,╛,┐,└,┴,┬,├,─,┼,╞,╟,╚,╔,╩,╦,╠,═,╬,╧,╨,╤,╥,╙,╘,╒,╓,╫,╪,┘,┌,█,▄,▌,▐,▀,ω,ά,έ,ή,ϊ,ί,ό,ύ,ϋ,ώ,Ά,Έ,Ή,Ί,Ό,Ύ,Ώ,±,≥,≤,Ϊ,Ϋ,÷,≈,°,∙,·,√,ⁿ,²,■"},"finish_reason":"stop","index":0}]} | ||
{"id":"chatcmpl-XXXXX","object":"chat.completion","created":1679326062,"model":"gpt-3.5-turbo-0301","usage":{"prompt_tokens":13,"completion_tokens":114,"total_tokens":127},"choices":[{"message":{"role":"assistant","content":"MS-DOS (Microsoft Disk Operating System) is a command-line operating system developed by Microsoft Corporation. It was first released in 1981 and was widely used in personal computers until the mid-1990s. MS-DOS is known for its command-line interface, which requires users to type in specific commands to execute tasks. It was also the predecessor to modern graphical user interface (GUI) operating systems, such as Windows. MS-DOS is no longer in common use today but is still used in some embedded systems and as a boot disk for troubleshooting purposes."},"finish_reason":"stop","index":0}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#define READ_STR_FORMAT "read %.*s" | ||
#define READ_SIZE_COMMAND 120 | ||
|
||
#define MAX_TO_READ 100 | ||
|
||
char commandToRead[READ_SIZE_COMMAND]; | ||
|
||
int sbtts_run_command(char * command, bool redirectStdout){ | ||
|
||
if(redirectStdout){ | ||
// Send stdout to nul | ||
freopen("nul", "r", stdout); | ||
} | ||
|
||
int returnCode = system(command); | ||
|
||
if(redirectStdout){ | ||
fflush(stdout); | ||
|
||
//Restore the stdout | ||
freopen("con", "a", stdout); | ||
} | ||
|
||
return returnCode; | ||
|
||
} | ||
|
||
void sbtts_init(){ | ||
sbtts_run_command("SBTALKER /dBLASTER", false); | ||
} | ||
|
||
void sbtts_end(){ | ||
sbtts_run_command("REMOVE", false); | ||
} | ||
|
||
void sbtts_read_this_phrase(char * phrase, int length, bool redirectStdout){ | ||
snprintf(commandToRead, READ_SIZE_COMMAND, READ_STR_FORMAT, length, phrase); | ||
sbtts_run_command(commandToRead, redirectStdout); | ||
} | ||
|
||
void sbtts_read_str(char * str_to_read, int length, bool redirectStdout){ | ||
|
||
int currentStartPointer = 0; | ||
|
||
if(length < MAX_TO_READ){ | ||
sbtts_read_this_phrase(str_to_read, length, redirectStdout); | ||
} else { | ||
//Look for first break | ||
for(int i = 0; i < length; i++){ | ||
char currentChar = str_to_read[i]; | ||
int currentLength = i - currentStartPointer; | ||
|
||
// Split along the punctuation | ||
if('!' <= currentChar && currentChar <= '/' | ||
|| ':' <= currentChar && currentChar <= '@' | ||
|| '[' <= currentChar && currentChar <= '`' | ||
|| '{' <= currentChar && currentChar <= '~' | ||
|| currentLength > MAX_TO_READ){ | ||
|
||
//printf("start %d length %d stop at %c\n", currentStartPointer, i - currentStartPointer, currentChar); | ||
sbtts_read_this_phrase(str_to_read + currentStartPointer, i - currentStartPointer, redirectStdout); | ||
currentStartPointer = i; | ||
} | ||
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
void sbtts_init(); | ||
void sbtts_end(); | ||
void sbtts_read_str(char * str_to_read, int length, bool redirectStdout); |
Oops, something went wrong.