I have the following python code. I get the following message when running it using a test script which I cannot send here:
while textstring[iterator].isspace(): # loop until we get other than space character
IndexError: string index out of range. Please find out why and correct the code.
def createWords(textstrings):
createdWords = [] # empty list
for textstring in textstrings: # iterate through each string in trxtstrings
iterator = 0
begin = iterator # new begin variable
while (iterator < len(textstring)): # iterate through each character in the string
finished = iterator # new finished character
while textstring[iterator].isspace(): # loop until we get other than space character
iterator = iterator+1
word = textstring[begin:finished+1].strip() # extract the word from begin position to before the space character,
# textstring[begin,finshed] ; strip() will remove white spaces at ends
if (word): # if word is not empty
createdWords.append(word) # append new word to createWords
begin = iterator # update begin value with current iterator position
if (textstring[iterator]).isalpha():
if (textstring[iterator].isupper()): # if letter is in uppercase change it to lower case by using letter.lower() method.
textstring = textstring[:iterator] + textstring[iterator].lower() + textstring[iterator+1:]
print(textstring[iterator],"this a letter")
elif (textstring[iterator]).isdigit():
print(textstring[iterator],"is a digit")
else:
print(textstring[iterator],"this a symbol")
word = textstring[begin:finished].strip() # extract the word from begin position to before the symbol character,
# textstring[begin,finshed] ; strip() will remove white spaces at ends
createdWords.append(word) # append new word to createWords
begin = iterator # update begin value with current iterator position
iterator= iterator+1 # increment iterator value
word = textstring[begin:iterator].strip() # extract the word from begin position to the end of the string
createdWords.append(word) # append new word to createWords
return createdWords # return createWordsIn: Computer Science
A (7, 4) cyclic code is designed with a generator polynomial, g(D) = D3 + D + 1. a) (10 points) Determine the code word for the message, 1010. b) (10 points) Determine the code word for the message, 1100. c) (9+1= 10 points) Determine the error polynomial for the received word, 1110101. Is the received word correct?
In: Computer Science
A (7, 4) cyclic code is designed with a generator polynomial, g(D) = D3 + D + 1. a) (10 points) Determine the code word for the message, 1010. b) (10 points) Determine the code word for the message, 1100. c) (9+1= 10 points) Determine the error polynomial for the received word, 1110101. Is the received word correct?
In: Computer Science
pseudo-code, please
If a word has a tag O, it means that the word has nothing to do with the named entity (it is not a part of a named entity such as a location, person name, organization, and etc.)
If a word has a tag starting with B, it means that the word is the beginning of a named entity. For instance, the tag B-per means that the associated word is the beginning of a person's name. On the other hand, if a word has a tag starting with I, it means the word is inside a named entity. Hence, the tag I-per means that the associated word is inside a person's name.
Thousands O
of O
demonstrators O
have O
marched O
through O
London B-geo
Take the following lines in the file for example.
President B-per
Mahmoud I-per
Ahmadinejad I-per
said O
We know the words “President, Mahmoud, and Ahmadinejad” cover a named entity of the type person name.
Could you write pseudo code to pull the names out of a file that are stated in the example
In: Computer Science
Question 1
Pain in a joint Blank 1 (Blank 2 - root word, Blank 3 - suffix)
2.00000 points
Question 2
With reference to something within a muscle : Blank 1 Blank 2 – prefix,(Blank 3 - root word, Blank 4 - suffix)
2.00000 points
Question 3
Refers to “beneath the skin : Blank 1 Blank 2 – prefix,(Blank 3 - root word, Blank 4 - suffix)
2.00000 points
Question 4
The process of viewing the esophagus, stomach and duodenum : Blank 1 (Blank 2 – root word,(Blank 3 - root word, Blank 4 - root word, Blank 5 - process of viewing)
2.00000 points
Question 5
Pertaining to (being) against seizures: Blank 1 (Blank 2 – prefix,(Blank 3 - root word, Blank 4 - suffix)
2.00000 points
Question 6
Inflammation of meninges : Blank 1 Blank 2 - root word, Blank 3 - suffix)
2.00000 points
Question 7
Inflammation of many nerves : Blank 1 ( Blank 2-prefix, Blank 3 - root word, Blank 4 - suffix)
2.00000 points
Question 8
Heart specialist : Blank 1 (Blank 2 - root word, Blank 3 - suffix)
2.00000 points
Question 9
Taking place within veins : Blank 1 Blank 2 – prefix,(Blank 3 - root word, Blank 4 - suffix)
2.00000 points
Question 10
Fat cell : Blank 1 Blank 2 - root word, Blank 3 - suffix)
2.00000 points
In: Nursing
Public static boolean isPalindrome(String word)
* Check to see if a word is a palindrome. Should be
case-independent.
* @param word a String without whitespace
* @return true if the word is a palindrome
Public static int longestWordLength(String words)
* Returns length of the longest word in the given String using
recursion (no loops).
* Hint: a Scanner may be helpful for finding word boundaries. After
delimiting by space,
* use the following method on your String to remove punctuation
{@code .replaceAll("[^a-zA-Z]", "")}
* If you use a Scanner, you will need a helper method to do the
recursion on the Scanner object.
* @param words A String containing one or more words.
* @return The length of the longest word in the String.
* @see Scanner#Scanner(String)
* @see Scanner#next()
* @see String#split(String)
* @see String#replaceAll(String, String)
* @see Math#max(int, int)
In: Computer Science
In: Computer Science
|
Alveoli |
Congestion |
Pleura |
|
Anthracosis |
Exudate |
Pneumocytes |
|
Bronchiole |
Fibrin |
Sequelae |
|
Bronchus |
Metamyelocytes |
Suppuration |
|
Term |
Meaning |
|
The process of forming puss that can occur during the process of eliminating stimulus of inflammation. |
|
|
Abnormal accumulation of blood or other fluids in blood vessel or body part. |
|
|
Cells and fluids that has seeped out of blood vessels or an organ. |
|
|
Small sacs within the lungs that allows oxygen and carbon dioxide to move between lungs and bloodstream. |
|
|
Cells lining the alveoli of the lungs – also called alveolar cells. |
|
|
Carbon pigment in the lung. |
|
|
Smaller branches of airway passages from bronchi in lungs leading to alveoli. |
|
|
Major airway passages within the lungs – these branch off to become smaller passages called bronchiole. |
|
|
Protein involved in clotting of blood. Generated from fibrinogen via action of thrombin. Polymerisation of fibrin with platelets forms clot over a wound. |
|
|
Cell undergoing maturation towards a granulocyte or granulopoiesis. Occurs primarily in the bone marrow. |
|
|
Membranes surrounding the lungs. Visceral pleura surrounds lungs and parietal pleura lines the inner chest wall. |
|
|
The condition that arises as a consequence of a previous injury, disease or therapy. |
In: Biology
|
Alveoli |
Congestion |
Pleura |
|
Anthracosis |
Exudate |
Pneumocytes |
|
Bronchiole |
Fibrin |
Sequelae |
|
Bronchus |
Metamyelocytes |
Suppuration |
|
Term |
Meaning |
|
The process of forming puss that can occur during the process of eliminating stimulus of inflammation. |
|
|
Abnormal accumulation of blood or other fluids in blood vessel or body part. |
|
|
Cells and fluids that has seeped out of blood vessels or an organ. |
|
|
Small sacs within the lungs that allows oxygen and carbon dioxide to move between lungs and bloodstream. |
|
|
Cells lining the alveoli of the lungs – also called alveolar cells. |
|
|
Carbon pigment in the lung. |
|
|
Smaller branches of airway passages from bronchi in lungs leading to alveoli. |
|
|
Major airway passages within the lungs – these branch off to become smaller passages called bronchiole. |
|
|
Protein involved in clotting of blood. Generated from fibrinogen via action of thrombin. Polymerisation of fibrin with platelets forms clot over a wound. |
|
|
Cell undergoing maturation towards a granulocyte or granulopoiesis. Occurs primarily in the bone marrow. |
|
|
Membranes surrounding the lungs. Visceral pleura surrounds lungs and parietal pleura lines the inner chest wall. |
|
|
The condition that arises as a consequence of a previous injury, disease or therapy. |
In: Biology
In: Advanced Math