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
95013989
Commit
95013989
authored
10 months ago
by
Noah Heuser
Browse files
Options
Downloads
Patches
Plain Diff
switched from BufferedWriter to FileWriter in method writePairsToFile
parent
f26f7af2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ChatGPTParsing/src/writer/Writer.java
+8
-7
8 additions, 7 deletions
ChatGPTParsing/src/writer/Writer.java
with
8 additions
and
7 deletions
ChatGPTParsing/src/writer/Writer.java
+
8
−
7
View file @
95013989
...
...
@@ -38,10 +38,10 @@ public class Writer {
return
grammarWordsPair
.
toString
();
}
private
void
writePairToFile
(
List
<
String
>
pairs
)
{
try
(
Buffered
Writer
b
w
=
new
Buffered
Writer
(
new
FileWriter
(
"//wsl.localhost/Ubuntu/home/noah/gptgrammarparsing/PythonAPI/grammarWordsPairs.txt"
))
)
{
b
w
.
write
(
pairs
.
toString
());
private
void
writePair
s
ToFile
(
List
<
String
>
pairs
)
{
try
(
File
Writer
f
w
=
new
File
Writer
(
"//wsl.localhost/Ubuntu/home/noah/gptgrammarparsing/PythonAPI/grammarWordsPairs.txt"
))
{
f
w
.
write
(
pairs
.
toString
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -49,7 +49,8 @@ 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
(
"resultsOfMembershipTest.txt"
)))
{
try
(
BufferedWriter
bw
=
new
BufferedWriter
(
new
FileWriter
(
"//wsl.localhost/Ubuntu/home/noah/gptgrammarparsing/PythonAPI/resultsOfMembershipTest.txt"
)))
{
int
i
=
0
;
int
k
=
0
;
for
(
Grammar
g
:
grammars
)
{
...
...
@@ -102,7 +103,7 @@ public class Writer {
grammarWordsPairs
.
add
(
createGrammarWordsPair
(
g
.
toString
(),
wordsPerGrammar
));
}
writeResultToFileType2
(
grammars
,
normalizedRuleSets
,
words
);
writePairToFile
(
grammarWordsPairs
);
writePair
s
ToFile
(
grammarWordsPairs
);
}
private
String
wordGeneratorType2
(
Map
<
String
,
List
<
List
<
String
>>>
normalizedRuleSet
,
int
alphaSize
,
int
j
)
{
...
...
@@ -146,7 +147,7 @@ public class Writer {
grammarWordsPairs
.
add
(
createGrammarWordsPair
(
g
.
toString
(),
grammarPerWords
));
}
writeResultToFileType3
(
fsms
,
words
);
writePairToFile
(
grammarWordsPairs
);
writePair
s
ToFile
(
grammarWordsPairs
);
}
public
static
void
main
(
String
[]
args
)
{
...
...
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