Usuń 'B00/run.py'

This commit is contained in:
Yevheniia Kryzhanovska 2023-11-10 12:13:36 +01:00
parent f92640b359
commit 1770eb5435

View File

@ -1,90 +0,0 @@
import sys
# global fsa_description
# global inputWords
# global outputResult
fsa_description = sys.argv[1]
inputWords = sys.argv[2]
outputResult = sys.argv[3]
def readDescription(currentPos, charInput):
with open(fsa_description, 'r', encoding="utf-8") as descript:
for line in descript:
if len(line.strip().split('\t')) == 1:
return line[0], 0
transition = line.strip().split('\t')
if len(transition) == 3 and currentPos == transition[0] and charInput == transition[2]:
return transition[1], 1
return None, None
answersYN = ''
with open(inputWords, 'r', encoding="utf-8") as inputString:
for line in inputString:
pos = '0'
for char in line:
if char == '\n':
answersYN+=('1' if pos == '3' else '0')
newPos, flag = readDescription(pos, char)
if flag == 1:
pos = newPos
with open(outputResult, 'w', encoding="utf-8") as output:
for i in range(0, len(answersYN)):
if answersYN[i] == '1':
output.write("YES\n")
elif answersYN[i] == '0':
output.write("NO\n")
print(answersYN)
#
# import sys
#
# acceptingPos = None
# def readDescription(currentPos, charInput):
# with open("fsa_description.arg", 'r', encoding="utf-8") as descript:
# # global acceptingPos
#
# for line in descript:
# if line.strip().split('\t')==1:
# # acceptingPos = line[0]
# return line[0], 0
# transition = line.strip().split('\t')
#
# if currentPos == transition[0] and charInput == transition[2]:
# return transition[1],1
# return None, None
#
# # startPos, endPos, char =
# # if currentPos==startPos and charInput==char:
# # currentPos = endPos
# # return currentPos, 1
#
# # return None, None
#
#
#
# answersYN=''
# with open("test1.in", 'r', encoding="utf-8") as inputString:
# currentPos=None
# for line in inputString:
# pos = '0'
# for char in line:
#
# if char == '\n':
# if pos == '3' :
# answersYN +='1'
#
# else:
# answersYN +='0'
# newPos, flag = readDescription(pos, char)
# if flag==1:
# pos = newPos
#
#
# print(answersYN)
#