Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GPTGrammarParsing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Noah Heuser
GPTGrammarParsing
Commits
0923716b
Commit
0923716b
authored
10 months ago
by
Noah Heuser
Browse files
Options
Downloads
Patches
Plain Diff
remove line breaks in grammar toString(), changed file path of result
files
parent
4f85bb95
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChatGPTParsing/src/grammar/Grammar.java
+4
-4
4 additions, 4 deletions
ChatGPTParsing/src/grammar/Grammar.java
ChatGPTParsing/src/writer/Writer.java
+5
-3
5 additions, 3 deletions
ChatGPTParsing/src/writer/Writer.java
with
9 additions
and
7 deletions
ChatGPTParsing/src/grammar/Grammar.java
+
4
−
4
View file @
0923716b
...
...
@@ -53,7 +53,7 @@ public abstract class Grammar {
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"G = (V, T, R, "
+
this
.
getStart
()
+
")
\n
"
);
sb
.
append
(
"G = (V, T, R, "
+
this
.
getStart
()
+
")
,
"
);
sb
.
append
(
"V = {"
);
for
(
int
i
=
0
;
i
<
this
.
getVars
().
length
;
i
++)
{
sb
.
append
(
this
.
getVars
()[
i
]);
...
...
@@ -61,7 +61,7 @@ public abstract class Grammar {
sb
.
append
(
", "
);
}
}
sb
.
append
(
"}
\n
"
);
sb
.
append
(
"}
,
"
);
sb
.
append
(
"T = {"
);
for
(
int
i
=
97
;
i
<
97
+
this
.
getAlphaSize
();
i
++)
{
sb
.
append
((
char
)
i
);
...
...
@@ -69,7 +69,7 @@ public abstract class Grammar {
sb
.
append
(
", "
);
}
}
sb
.
append
(
"}
\n
"
);
sb
.
append
(
"}
,
"
);
sb
.
append
(
"R = {"
);
Iterator
<
Entry
<
String
,
List
<
List
<
String
>>>>
it
=
this
.
getRules
().
entrySet
().
iterator
();
while
(
it
.
hasNext
())
{
...
...
@@ -91,7 +91,7 @@ public abstract class Grammar {
}
}
if
(
it
.
hasNext
())
{
sb
.
append
(
",
\n
"
);
sb
.
append
(
", "
);
}
}
sb
.
append
(
"}"
);
...
...
This diff is collapsed.
Click to expand it.
ChatGPTParsing/src/writer/Writer.java
+
5
−
3
View file @
0923716b
...
...
@@ -39,7 +39,8 @@ public class Writer {
}
private
void
writePairToFile
(
List
<
String
>
pairs
)
{
try
(
BufferedWriter
bw
=
new
BufferedWriter
(
new
FileWriter
(
"../PythonAPI/grammarWordsPairs.txt"
)))
{
try
(
BufferedWriter
bw
=
new
BufferedWriter
(
new
FileWriter
(
"//wsl.localhost/Ubuntu/home/noah/gptgrammarparsing/PythonAPI/grammarWordsPairs.txt"
)))
{
bw
.
write
(
pairs
.
toString
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
@@ -48,7 +49,7 @@ public class Writer {
private
void
writeResultToFileType2
(
List
<
Grammar
>
grammars
,
List
<
Map
<
String
,
List
<
List
<
String
>>>>
normalizedRuleSet
,
List
<
String
>
words
)
{
try
(
BufferedWriter
bw
=
new
BufferedWriter
(
new
FileWriter
(
"
../PythonAPI/
resultsOfMembershipTest.txt"
)))
{
try
(
BufferedWriter
bw
=
new
BufferedWriter
(
new
FileWriter
(
"resultsOfMembershipTest.txt"
)))
{
int
i
=
0
;
int
k
=
0
;
for
(
Grammar
g
:
grammars
)
{
...
...
@@ -66,7 +67,8 @@ public class Writer {
}
private
void
writeResultToFileType3
(
List
<
FiniteStateMachine
>
fsms
,
List
<
String
>
words
)
{
try
(
BufferedWriter
bw
=
new
BufferedWriter
(
new
FileWriter
(
"../PythonAPI/resultsOfMembershipTest.txt"
)))
{
try
(
BufferedWriter
bw
=
new
BufferedWriter
(
new
FileWriter
(
"//wsl.localhost/Ubuntu/home/noah/gptgrammarparsing/PythonAPI/resultsOfMembershipTest.txt"
)))
{
int
i
=
0
;
for
(
FiniteStateMachine
fsm
:
fsms
)
{
for
(
int
j
=
0
;
j
<
DISTINCT_WORDS
;
j
++)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment