nouf-sst commited on
Commit
81ddd61
1 Parent(s): 0224aa7

fix indentation error

Browse files
Files changed (1) hide show
  1. app.py +23 -24
app.py CHANGED
@@ -188,30 +188,29 @@ def is_complex_sentence(sentence):
188
  return False
189
 
190
  def get_complex_sentences(elements):
191
-
192
- complex_sentences = []
193
-
194
- for key, value in elements.items():
195
- for i in range(0, len(elements[key])):
196
- if is_complex_sentence(elements[key][i]):
197
- complex_sentences.append(elements[key][i])
198
-
199
- if complex_sentences:
200
- output = ""
201
- for complex_sentence in complex_sentences:
202
- refactored_element = prompt(
203
- '''
204
- You are a specialist in English linguistics.
205
- A complex sentence is a sentence with one independent clause and at least one dependent clause. A simple sentence has a single independent clause.
206
- You will be provided with a complex sentence, and your task is to make it a simple sentence.
207
- Do not convert a verb phrase to a noun phrase, and vice versa.
208
- Answer with the new sentence only.
209
- ''', complex_sentence)
210
- output = output + '"' + complex_sentence + '" should be refactored to "' + refactored_element + '"\n'
211
- #complex_sentences = "\n".join(complex_sentences)
212
- return "Complex elements:\n" + output
213
- else:
214
- return ""
215
 
216
  # #####################################
217
 
 
188
  return False
189
 
190
  def get_complex_sentences(elements):
191
+
192
+ complex_sentences = []
193
+
194
+ for key, value in elements.items():
195
+ for i in range(0, len(elements[key])):
196
+ if is_complex_sentence(elements[key][i]):
197
+ complex_sentences.append(elements[key][i])
198
+
199
+ if complex_sentences:
200
+ output = ""
201
+ for complex_sentence in complex_sentences:
202
+ refactored_element = prompt(
203
+ '''
204
+ You are a specialist in English linguistics.
205
+ A complex sentence is a sentence with one independent clause and at least one dependent clause. A simple sentence has a single independent clause.
206
+ You will be provided with a complex sentence, and your task is to make it a simple sentence.
207
+ Do not convert a verb phrase to a noun phrase, and vice versa.
208
+ Answer with the new sentence only.
209
+ ''', complex_sentence)
210
+ output = output + '"' + complex_sentence + '" should be refactored to "' + refactored_element + '"\n'
211
+ return "Complex elements:\n" + output
212
+ else:
213
+ return ""
 
214
 
215
  # #####################################
216