Essay Available:
page:
2 pages/≈550 words
Sources:
4
Style:
Other
Subject:
IT & Computer Science
Type:
Coursework
Language:
English (U.S.)
Document:
MS Word
Date:
Total cost:
$ 12.96
Topic:
Bash coding in Corpus linguistics, Treebanks and Corpora parsing
Coursework Instructions:
Instructions and are in Homework3.PDF, html&json files are supporting data for completing the questions.
You might need to access my school's server, in that case, just leave "__PATH", Bold italic, where I should replace with the actual path later.
Coursework Sample Content Preview:
Homework 3
Student’s Name
University Name
Course Number and Name
Professor’s Name
Date
Question 1
While working on this question, I realized that PowerShell did not support some bash syntax directly. As such, I resulted to using Git Bash which easily provides a Unix-like environment to run the required commands. In Git Bash I used the following commands:
PC@DESKTOP-OGFVL0N MINGW64 ~
$ cd Desktop/Bash
PC@DESKTOP-OGFVL0N MINGW64 ~/Desktop/Bash
$ he_count=$(grep -o -i "he" capitol-riot-table-20210204.html | wc -l)
PC@DESKTOP-OGFVL0N MINGW64 ~/Desktop/Bash
$ she_count=$(grep -o -i "she" capitol-riot-table-20210204.html | wc -l)
PC@DESKTOP-OGFVL0N MINGW64 ~/Desktop/Bash
$ ratio_he=$(awk "BEGIN {print $he_count / ($he_count + $she_count)}")
echo "Ratio (he / (he + she)):" $ratio_he
Ratio (he / (he + she)): 0.972945
PC@DESKTOP-OGFVL0N MINGW64 ~/Desktop/Bash
$ pleaded_guilty_count=$(grep -o -i "pleaded guilty" capitol-riot-table-20210204.html | wc -l)
PC@DESKTOP-OGFVL0N MINGW64 ~/Desktop/Bash
$ pleaded_count=$(grep -o -i "pleaded" capitol-riot-table-20210204.html | wc -l)
PC@DESKTOP-OGFVL0N MINGW64 ~/Desktop/Bash
$ ratio_pleaded=$(awk "BEGIN {print $pleaded_guilty_count / $pleaded_count}")
echo "Ratio (pleaded guilty / pleaded):" $ratio_pleaded
Ratio (pleaded guilty / pleaded): 0.32838
From the code above, line one is used to change directory into “Bash” folder which contains the assignment files and particularly the “capitol-riot-table-20210204.html” file which is required in this question. The second and third lines are similar in that they use grep command with -o and -I to get the count of the words “he” and “she” as required. Similar commands are repeated while counting the words “pleaded guilty” and “pleaded” as shown in command lines 5 and 6. Finally, the awk command was utilized to calculate the required ratios as presented in code lines 4 and 7. As shown in th...
Get the Whole Paper!
Not exactly what you need?
Do you need a custom essay? Order right now:
👀 Other Visitors are Viewing These APA Essay Samples:
-
Assignment 1--Part 1: Supervised Learning with Sklearn
2 pages/≈550 words | 3 Sources | Other | IT & Computer Science | Coursework |
-
Data
1 page/≈275 words | No Sources | Other | IT & Computer Science | Coursework |
-
Identity Guide
1 page/≈275 words | No Sources | Other | IT & Computer Science | Coursework |