Paul Bird
commited on
Commit
•
1d9995e
1
Parent(s):
a7c324f
Upload RunTinyStories.cs
Browse files- RunTinyStories.cs +4 -4
RunTinyStories.cs
CHANGED
@@ -53,7 +53,7 @@ public class RunTinyStories : MonoBehaviour
|
|
53 |
|
54 |
// Used for special character decoding
|
55 |
int[] whiteSpaceCharacters = new int[256];
|
56 |
-
int[]
|
57 |
|
58 |
bool runInference = false;
|
59 |
|
@@ -196,7 +196,7 @@ public class RunTinyStories : MonoBehaviour
|
|
196 |
string outText = "";
|
197 |
foreach (char letter in text)
|
198 |
{
|
199 |
-
outText += (char)
|
200 |
}
|
201 |
return outText;
|
202 |
}
|
@@ -205,10 +205,10 @@ public class RunTinyStories : MonoBehaviour
|
|
205 |
{
|
206 |
for (int i = 0, n = 0; i < 256; i++)
|
207 |
{
|
208 |
-
|
209 |
if (IsWhiteSpace((char)i))
|
210 |
{
|
211 |
-
|
212 |
whiteSpaceCharacters[n++] = i;
|
213 |
}
|
214 |
}
|
|
|
53 |
|
54 |
// Used for special character decoding
|
55 |
int[] whiteSpaceCharacters = new int[256];
|
56 |
+
int[] encodedCharacters = new int[256];
|
57 |
|
58 |
bool runInference = false;
|
59 |
|
|
|
196 |
string outText = "";
|
197 |
foreach (char letter in text)
|
198 |
{
|
199 |
+
outText += (char)encodedCharacters[(int)letter];
|
200 |
}
|
201 |
return outText;
|
202 |
}
|
|
|
205 |
{
|
206 |
for (int i = 0, n = 0; i < 256; i++)
|
207 |
{
|
208 |
+
encodedCharacters[i] = i;
|
209 |
if (IsWhiteSpace((char)i))
|
210 |
{
|
211 |
+
encodedCharacters[i] = n + 256;
|
212 |
whiteSpaceCharacters[n++] = i;
|
213 |
}
|
214 |
}
|