Skip to content

Commit

Permalink
(1) 'Parse_' prefixed to the lang.dat-files plus code-adapts (2) made…
Browse files Browse the repository at this point in the history
… start with data-file-validation-proc
  • Loading branch information
some-avail committed Sep 16, 2023
1 parent dbefe9a commit 871de97
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 13 deletions.
2 changes: 1 addition & 1 deletion mostfiles/flashread.nim
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ routes:
innervarob["statustext"] = newlang(statustekst)
innervarob["statusdata"] = ""
innervarob["pastedtext"] = ""
innervarob["processedtext"] = filepathst
innervarob["processedtext"] = filepathst & "<br><br>" & evaluateDataFiles(datFileAll)
innervarob["text_language"] = setDropDown("text-language", readOptionFromFile("text-language", "value"))
innervarob["taglist"] = setDropDown("taglist", "paragraph-with-headings")
innervarob["radiobuttons_1"] = setRadioButtons("orders","")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ arguments---none
.
LICENSE
settings_flashread.conf
dutch.dat
english.dat
german.dat
parse_dutch.dat
parse_english.dat
parse_german.dat
language_template.dat
summary_dutch_concise.dat
summary_dutch_default.dat
Expand Down
4 changes: 1 addition & 3 deletions mostfiles/loadgui.nim
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ proc loadTextLangsFromConfig() =
# Load the processing-languages of the dropdown "dropdownsta" of
# webgui_def.nim from the config-file


var
valuelist: string
sourcelangsq: seq[string]
langvaluelistsq: seq[array[2, string]]
tbo: bool = false


# get the processing-languages from the config-file
valuelist = readOptionFromFile("text-language", "value-list")
sourcelangsq = valuelist.split(",,")
Expand All @@ -47,7 +45,7 @@ proc loadTextLangsFromConfig() =

# generate the new valuelist
for langst in sourcelangsq:
if fileExists(langst & ".dat"):
if fileExists("parse_" & langst & ".dat"):
langvaluelistsq.add([langst, capitalizeAscii(langst)])

if tbo: echo langvaluelistsq
Expand Down
3 changes: 3 additions & 0 deletions mostfiles/dutch.dat → mostfiles/parse_dutch.dat
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,9 @@ treed
treden
trad
traden
dreigen
dreigt
dreigd
reken
rekent
rekend
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion mostfiles/process_text.nim
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ proc applyDefinitionFileToText(input_tekst, languagest: string,

if highlightbo == false:
log("text coloring....")
def_filenamest = languagest & ".dat"
def_filenamest = "parse_" & languagest & ".dat"
deffilest = textsourcefileta[def_filenamest]
blockheadersq = @[
"PUNCTUATION OF SENTENCES TO HANDLE",
Expand Down
53 changes: 49 additions & 4 deletions mostfiles/source_files.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ import os
import fr_tools



type
DataFileType* = enum
datFileLanguage
datFileSummary
datFileAll


var
versionfl:float = 0.2
textsourcefilesq: seq[string] = @["outer_html.html",
Expand All @@ -20,8 +28,10 @@ var
faultsfoundbo: bool = false


proc addLanguageFiles() =
# dynamicly add the language.dat files from the config-file
proc addLanguageFilesToList() =
# Dynamicly add the language.dat files from the config-file
# to the list textsourcefilesq

var
valuelist: string
sourcelangsq:seq[string]
Expand All @@ -36,7 +46,8 @@ proc addLanguageFiles() =

# generate the new valuelist
for langst in sourcelangsq:
textsourcefilesq.add(langst & ".dat")
# textsourcefilesq.add(langst & ".dat")
textsourcefilesq.add("parse_" & langst & ".dat")

if tbo: echo textsourcefilesq

Expand All @@ -61,9 +72,43 @@ proc loadTextSourceFiles() =
echo repr(errob) & "\p****End exception****\p"


addLanguageFiles()


proc writeFilePatternToSeq*(filestartwithst: string): seq[string] =

#[ Write the files from pattern in the current dir to the sequence and
return that]#

var
filelisq: seq[string]
filenamest: string


# walk thru the file-iterator and sequence the right file(names)
for kind, path in walkDir(getAppDir()):
if kind == pcFile:
filenamest = extractFileName(path)
if len(filenamest) > len(filestartwithst):
if filenamest[0..len(filestartwithst) - 1] == filestartwithst:
# log(filenamest)
filelisq.add(filenamest)

result = filelisq




proc evaluateDataFiles*(filetypeu: DataFileType): string =

result = "Nothing evaluated yet"



addLanguageFilesToList()
loadTextSourceFiles()



when isMainModule:
# echo textsourcefileta["dutch.dat"]
echo sourcefilestatust
Expand Down
1 change: 1 addition & 0 deletions mostfiles/summary_english_concise.dat
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ definition
mechanism
method
caus
effect
result
consequence
reason
Expand Down
4 changes: 3 additions & 1 deletion mostfiles/summary_english_default.dat
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ effects
task
influence
category
classification
classif
type
theor
supposition
Expand Down Expand Up @@ -78,5 +78,7 @@ develop
goal
evidence
proof
question
answer
>----------------------------------<

0 comments on commit 871de97

Please sign in to comment.