Skip to content

Commit 1d225d8

Browse files
Added functionalities
1 parent a7b22f6 commit 1d225d8

File tree

2 files changed

+95
-5
lines changed

2 files changed

+95
-5
lines changed

memrise-scraper/memrise_mapper.txt

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,64 @@
11
abate => to decrease; reduce
2+
In an hour or so the storm would abate and they could leave.
3+
I took Laura some homemade cookies, hoping to abate her sadness.
4+
Taking pain medicine can cause headaches to abate.
5+
The crowd's roar began to abate after a few minutes of excitement.
6+
!-------------------!
7+
28
abdicate => to give up a position, right, or power
9+
He agreed to abdicate and retire in favor of the next in line for the throne.
10+
The King decided to abdicate in favor of his son.
11+
Edward VIII was the only British monarch who voluntarily abdicated the throne.
12+
He abdicated government here, by declaring us out of his protection and waging war against us.
13+
!-------------------!
14+
315
aberrant => deviating from what is normal
16+
Except in a few aberrant types, which are mentioned below, the mouth is surrounded by a much developed lip like a funnel directed downwards, and is armed with a horny beak not unlike that of a cuttle-fish.
17+
In the Malacostraca, an elongated heart with numerous segmentally arranged ostia is found only in the aberrant group of Stomatopoda and in the transitional Phyllocarida.
18+
They are not tales of aberrant individuals but of societal norms.
19+
Eyestalks and the antennules in this aberrant group correspond to the primitive head somites or not, their distinctness is certainly a secondarily acquired character, for it is not found in the larvae, nor in any of the more primitive groups of Malacostraca.
20+
!-------------------!
21+
422
abeyance => temporary suppression or suspension
23+
This regulation fell into abeyance after the 12th century, and such inscriptions are very rare.
24+
It is more probably abeyance of external function during a periodic internal assimilatory phase.
25+
Then the Sudan was abandoned and the railway remained in abeyance until 1905-1906, when the line was at length built.
26+
The last may be considered in abeyance as there has not been any coronation banquet since that of George IV.
27+
!-------------------!
28+
529
abject => miserable; pitiful
30+
The poor surroundings caused abject misery.
31+
The situation created abject terror.
32+
He died in abject poverty in 1961 at the age of 57 years.
33+
Abject humiliation followed the scene with the elders.
34+
!-------------------!
35+
636
abjure => to reject; abandon formally
37+
With a crusade, Ninoslav was baptized, only to abjure Christianity in 1233.
38+
He was asked whether certain books had been written by him and whether he was prepared to maintain or to abjure what he had written.
39+
At the council of Pisa, where he was compelled to abjure his errors and was sentenced to imprisonment.
40+
Among the propositions he could heartily abjure was that relating to transubstantiation; among those he felt constrained unflinchingly to maintain was one which had given great offence, to the effect that Christ, not Peter, is the head of the church to whom ultimate appeal must be made.
41+
!-------------------!
42+
743
abscission => the act of cutting; the natural separation of a leaf or other part of a plant
44+
It consists of (a) those churches which have accepted all the decrees of the first seven general councils, and have remained in full communion with one another, (b) such churches as have derived their origin from these by missionary activity, or by abscission without loss of communion.
45+
!-------------------!
46+
847
abscond => to depart secretly
48+
No sentences.. :(
49+
!-------------------!
50+
951
abstemious => moderate in appetite
52+
He went thoroughly into the practice as well as the theory of Stoicism, and lived so abstemious and laborious a life that he injured his health.
53+
Browne was a man of abstemious habits, charitable disposition, and impressive eloquence.
54+
Abstemious in his habits, he possessed great physical endurance.
55+
You know me: I am busy from morning till night and abstemious, so of course I am well.
56+
!-------------------!
57+
1058
abstinence => the giving up of certain pleasures
59+
A nearly vegetarian diet and a complete abstinence from alcoholic stimulants is the ideal in such cases, but it must be modified to suit individuals, as sometimes very strict limitations prove injurious.
60+
In the above countries, therefore, abstinence from matrimony may be said to have been a factor of some importance in the decline.
61+
With the growth of the Oxford Movement in the English Church, the practice of observing Lent was revived; and, though no rules for fasting are authoritatively laid down, the duty of abstinence is now very generally inculcated by bishops and clergy, either as a discipline or as an exercise in self-denial.
62+
A fourth was subsequently added, for the sake of symmetry, to make them correspond with the four seasons, and they became known as the jejunium vernum, aestivum, autumnale and hiemale, so that, to quote Pope Leo's words, "the law of abstinence might apply to every season of the year."
63+
!-------------------!
64+

memrise-scraper/memrise_scraper.py

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,26 @@
33
import time
44

55
memrise_url = "https://www.memrise.com/course/121215/barrons-800-essential-word-list-gre/"
6-
sentences_url = "sentence.yourdictionary.com/"
6+
sentences_url = "http://sentence.yourdictionary.com/"
77

88
mapping = dict()
99
combine = []
10+
glob_s = []
11+
12+
sentence_map = dict()
13+
14+
def get_sentences(ur):
15+
url = ur
16+
print(url)
17+
response = req.urlopen(url)
18+
data = response.read()
19+
soup = BeautifulSoup(data, 'lxml')
20+
sentences = []
21+
for s in soup.find_all("li", class_ = 'voting_li'):
22+
sentence = s.find("div", class_ = 'li_content')
23+
#print(sentence.text)
24+
sentences.append(sentence.text)
25+
return sentences
1026

1127
for i in range(1,81):
1228
url = memrise_url + str(i) + "/"
@@ -16,14 +32,34 @@
1632
for w in soup.find_all("div", class_ = "thing text-text"):
1733
word = w.find("div", class_ = "col_a col text")
1834
meaning = w.find("div", class_ = "col_b col text")
35+
sentence = sentences_url + word.text
36+
sentences = get_sentences(sentence)
37+
sentences = sentences[:4]
38+
1939
combine.append((word.text, meaning.text))
40+
#glob_s.append(sentences)
41+
sentence_map[word.text] = sentences
42+
2043
if word.text not in mapping:
2144
mapping[word.text] = meaning.text
2245
antimapping = dict((y, x) for x,y in mapping.items())
23-
time.sleep(2)
24-
break
46+
time.sleep(3)
47+
48+
with open("memrise_mapper.txt", 'r') as f:
49+
contents = f.read()
2550

2651
with open("memrise_mapper.txt", 'a') as mfile:
2752
for ele in combine:
28-
writetotxt = str(ele[0]) + " => " + str(ele[1]) + "\n"
29-
mfile.write(writetotxt)
53+
if ele[0] in contents:
54+
print("Mapping already exists.")
55+
else:
56+
writetotxt = str(ele[0]) + " => " + str(ele[1]) + "\n"
57+
#mfile.write("!-------------------!\n")
58+
mfile.write(writetotxt)
59+
if ele[0] in sentence_map.keys() and len(sentence_map[ele[0]]) != 0:
60+
for s in sentence_map[ele[0]]:
61+
mfile.write(s + "\n")
62+
mfile.write("!-------------------!\n\n")
63+
else:
64+
mfile.write("No sentences.. :( \n")
65+
mfile.write("!-------------------!\n\n")

0 commit comments

Comments
 (0)