- Sambucus is a genus of flowering plants in the family Adoxaceae.
+ Sambucus is a genus of flowering plants in the family Adoxaceae.
- The various species are commonly called elder or elderberry.
+ The various species are commonly called elder or elderberry.
- The genus was formerly placed in the honeysuckle family, Caprifoliaceae, but was reclassified as Adoxaceae due to genetic and morphological comparisons to plants in the genus Adoxa.
+ The genus was formerly placed in the honeysuckle family, Caprifoliaceae, but was reclassified as Adoxaceae due to genetic and morphological comparisons to plants in the genus Adoxa.
-
Description
+
Description
- The oppositely arranged leaves are pinnate with 5–9 leaflets (or, rarely, 3 or 11).
+ The oppositely arranged leaves are pinnate with 5–9 leaflets (or, rarely, 3 or 11).
- Each leaf is 5–30 cm (2–12 in) long, and the leaflets have serrated margins.
+ Each leaf is 5–30 cm (2–12 in) long, and the leaflets have serrated margins.
- They bear large clusters of small white or cream-colored flowers in late spring; these are followed by clusters of small black, blue-black, or red berries (rarely yellow or white).
+ They bear large clusters of small white or cream-colored flowers in late spring; these are followed by clusters of small black, blue-black, or red berries (rarely yellow or white).
-
Color
+
Color
- Sambucus fruit is rich in anthocyanidins that combine to give elderberry juice an intense blue-purple coloration that turns reddish on dilution with water.
+ Sambucus fruit is rich in anthocyanidins that combine to give elderberry juice an intense blue-purple coloration that turns reddish on dilution with water.
- These pigments are used as colorants in various products, and "elderberry juice color" is listed by the US FDA as allowable in certified organic food products.
+ These pigments are used as colorants in various products, and "elderberry juice color" is listed by the US FDA as allowable in certified organic food products.
- In Japan, elderberry juice is listed as an approved "natural color additive" under the Food and Sanitation Law. Fibers can be dyed with elderberry juice (using alum as a mordant) to give a light "elderberry" color.
+ In Japan, elderberry juice is listed as an approved "natural color additive" under the Food and Sanitation Law. Fibers can be dyed with elderberry juice (using alum as a mordant) to give a light "elderberry" color.
-
Toxicity
+
Toxicity
- Although the cooked berries (pulp and skin) of most species of Sambucus are edible, the uncooked berries and other parts of plants from this genus are poisonous.
+ Although the cooked berries (pulp and skin) of most species of Sambucus are edible, the uncooked berries and other parts of plants from this genus are poisonous.Leaves, twigs, branches, seeds, roots, flowers, and berries of Sambucus plants produce cyanogenic glycosides, which have toxic properties.
- Ingesting a sufficient quantity of cyanogenic glycosides from berry juice, flower tea, or beverages made from fresh leaves, branches, and fruit has been shown to cause illness, including nausea, vomiting, abdominal cramps, diarrhea, and weakness.
+ Ingesting a sufficient quantity of cyanogenic glycosides from berry juice, flower tea, or beverages made from fresh leaves, branches, and fruit has been shown to cause illness, including nausea, vomiting, abdominal cramps, diarrhea, and weakness.
- In August 1983, a group of 25 people in Monterey County, California, became suddenly ill by ingesting elderberry juice pressed from fresh, uncooked Sambucus mexicana berries, leaves, and stems.
+ In August 1983, a group of 25 people in Monterey County, California, became suddenly ill by ingesting elderberry juice pressed from fresh, uncooked Sambucus mexicana berries, leaves, and stems.
- The density of cyanogenic glycosides is higher in tea made from flowers (or leaves) than from the berries.The seeds of Sambucus callicarpa are reported to be poisonous and may cause vomiting or diarrhea.
+ The density of cyanogenic glycosides is higher in tea made from flowers (or leaves) than from the berries.The seeds of Sambucus callicarpa are reported to be poisonous and may cause vomiting or diarrhea.
-
Taxonomy
+
Taxonomy
- The taxonomy of the genus Sambucus L., originally described by Carl Linnaeus and hence its botanical authority, has been complicated by its wide geographical distribution and morphological diversity.
+ The taxonomy of the genus Sambucus L., originally described by Carl Linnaeus and hence its botanical authority, has been complicated by its wide geographical distribution and morphological diversity.
- This has led to overdescription of the species and infraspecific taxa (subspecies, varieties or forms).
+ This has led to overdescription of the species and infraspecific taxa (subspecies, varieties or forms).
- The name comes from the Greek word sambuce, an ancient wind instrument, about the removal of pith from the twigs to make whistles.Species recognized in this genus are:
+ The name comes from the Greek word sambuce, an ancient wind instrument, about the removal of pith from the twigs to make whistles.Species recognized in this genus are:
-
Distribution and habitat
+
Distribution and habitat
- The genus occurs in temperate to subtropical regions of the world.
+ The genus occurs in temperate to subtropical regions of the world.
- More widespread in the Northern Hemisphere, its Southern Hemisphere occurrence is restricted to parts of Australasia and South America.
+ More widespread in the Northern Hemisphere, its Southern Hemisphere occurrence is restricted to parts of Australasia and South America.
- Many species are widely cultivated for their ornamental leaves, flowers, and fruit.
+ Many species are widely cultivated for their ornamental leaves, flowers, and fruit.
-
Habitat
+
Habitat
- Elder commonly grows near farms and homesteads.
+ Elder commonly grows near farms and homesteads.
- It is a nitrogen-dependent plant and thus is generally found near places of organic waste disposal.
+ It is a nitrogen-dependent plant and thus is generally found near places of organic waste disposal.
- Elders are often grown as a hedgerow plant in Britain since they take very fast, can be bent into shape easily, and grow quite profusely, thus having gained the reputation of being 'an instant hedge'.
+ Elders are often grown as a hedgerow plant in Britain since they take very fast, can be bent into shape easily, and grow quite profusely, thus having gained the reputation of being 'an instant hedge'.
- It is not generally affected by soil type or pH level and will virtually grow anywhere sufficient sunlight is available.
+ It is not generally affected by soil type or pH level and will virtually grow anywhere sufficient sunlight is available.
-
Ecology
+
Ecology
- In Northern California, elderberries are a food for migrating band-tailed pigeons.
+ In Northern California, elderberries are a food for migrating band-tailed pigeons.
- Elders are used as food plants by the larvae of some Lepidoptera species including brown-tail, buff ermine, dot moth, emperor moth, engrailed moth, swallow-tailed moth and the V-pug.
+ Elders are used as food plants by the larvae of some Lepidoptera species including brown-tail, buff ermine, dot moth, emperor moth, engrailed moth, swallow-tailed moth and the V-pug.
- The crushed foliage and immature fruit have a strong fetid smell.
+ The crushed foliage and immature fruit have a strong fetid smell.
- Valley elderberry longhorn beetles in California are very often found around red or blue elderberry bushes.
+ Valley elderberry longhorn beetles in California are very often found around red or blue elderberry bushes.Females lay their eggs on the bark.
- The pith of elder has been used by watchmakers for cleaning tools before intricate work.
+ The pith of elder has been used by watchmakers for cleaning tools before intricate work.
-
Cultivation
+
Cultivation
- Traditional uses of Sambucus involved berries, seeds, leaves, and flowers or component extracts.
+ Traditional uses of Sambucus involved berries, seeds, leaves, and flowers or component extracts.
- Ornamental varieties of Sambucus are grown in gardens for their showy flowers, fruits and lacy foliage which support habitat for wildlife.
+ Ornamental varieties of Sambucus are grown in gardens for their showy flowers, fruits and lacy foliage which support habitat for wildlife.
- Of the many native species, three are used as ornamentals, S.
+ Of the many native species, three are used as ornamentals, S.
- nigra, S.
+ nigra, S.canadensis and S.racemosa.
-
Uses
+
Uses
-
Nutrition
+
Nutrition
- Raw elderberries are 80% water, 18% carbohydrates, and less than 1% each of protein and fat (table).
+ Raw elderberries are 80% water, 18% carbohydrates, and less than 1% each of protein and fat (table).
- In a 100-gram (3+1⁄2 oz) amount, elderberries supply 305 kilojoules (73 kcal) of food energy and are a rich source of vitamin C, providing 43% of the Daily Value (DV).
+ In a 100-gram (3+1⁄2 oz) amount, elderberries supply 305 kilojoules (73 kcal) of food energy and are a rich source of vitamin C, providing 43% of the Daily Value (DV).
- Elderberries also have moderate contents of vitamin B6 (18% DV) and iron (12% DV), with no other nutrients in significant content.
+ Elderberries also have moderate contents of vitamin B6 (18% DV) and iron (12% DV), with no other nutrients in significant content.
-
Dietary supplement
+
Dietary supplement
- Elderberry fruit or flowers are used as dietary supplements to prevent or provide relief from minor diseases, such as flu, colds, constipation, and other conditions, served as a tea, extract or in a capsule.
+ Elderberry fruit or flowers are used as dietary supplements to prevent or provide relief from minor diseases, such as flu, colds, constipation, and other conditions, served as a tea, extract or in a capsule.
- The use of elderberry supplements increased early in the COVID-19 pandemic.
+ The use of elderberry supplements increased early in the COVID-19 pandemic.
- There is insufficient research to establish its effectiveness for such uses, or its safety profile.
+ There is insufficient research to establish its effectiveness for such uses, or its safety profile.
- The raw or unripe fruit of S.
+ The raw or unripe fruit of S.
- nigra or its extracts may contain a cyanogenic glycoside that is potentially toxic.
+ nigra or its extracts may contain a cyanogenic glycoside that is potentially toxic.
-
Traditional medicine
+
Traditional medicine
- Although practitioners of traditional medicine have used elderberry over centuries, there is no high-quality clinical evidence that such practices provide any benefit.
+ Although practitioners of traditional medicine have used elderberry over centuries, there is no high-quality clinical evidence that such practices provide any benefit.
- The flowers of Sambucus nigra are used to produce elderflower cordial.
+ The flowers of Sambucus nigra are used to produce elderflower cordial.
- St-Germain, a French liqueur, is made from elderflowers.
+ St-Germain, a French liqueur, is made from elderflowers.
- Hallands Fläder, a Swedish akvavit, is flavoured with elderflowers.
+ Hallands Fläder, a Swedish akvavit, is flavoured with elderflowers.
- Hollowed elderberry twigs have traditionally been used as spiles to tap maple trees for syrup.
+ Hollowed elderberry twigs have traditionally been used as spiles to tap maple trees for syrup.
- Additionally, they have been hollowed out and used as flutes, blowguns, and syringes.The fruit of S.
+ Additionally, they have been hollowed out and used as flutes, blowguns, and syringes.The fruit of S.
- callicarpa is eaten by birds and mammals.
+ callicarpa is eaten by birds and mammals.
- It is inedible to humans when raw but can be made into wine.Elderberry twigs and fruit are employed in creating dyes for basketry.
+ It is inedible to humans when raw but can be made into wine.Elderberry twigs and fruit are employed in creating dyes for basketry.
- These stems are dyed a very deep black by soaking them in a wash made from the berry stems of the elderberry.
+ These stems are dyed a very deep black by soaking them in a wash made from the berry stems of the elderberry.
-
In popular culture
+
In popular culture
- Folklore related to elder trees is extensive and can vary according to region.
+ Folklore related to elder trees is extensive and can vary according to region.
- In some traditions, the elder tree is thought to ward off evil and give protection from witches, while other beliefs say that witches often congregate under the plant, especially when it is full of fruit.
+ In some traditions, the elder tree is thought to ward off evil and give protection from witches, while other beliefs say that witches often congregate under the plant, especially when it is full of fruit.
- If an elder tree was cut down, a spirit known as the Elder Mother would be released and take her revenge.
+ If an elder tree was cut down, a spirit known as the Elder Mother would be released and take her revenge.
- The tree could only safely be cut while chanting a rhyme to the Elder Mother.Made from the branch of an elder tree, the Elder Wand plays a pivotal role in the final book of the Harry Potter series, which was nearly named Harry Potter and the Elder Wand before author J.
+ The tree could only safely be cut while chanting a rhyme to the Elder Mother.Made from the branch of an elder tree, the Elder Wand plays a pivotal role in the final book of the Harry Potter series, which was nearly named Harry Potter and the Elder Wand before author J.
- K. Rowling decided on Harry Potter and the Deathly Hallows.Elton John's 1973 album Don't Shoot Me I'm Only the Piano Player features a song titled "Elderberry Wine".
+ K. Rowling decided on Harry Potter and the Deathly Hallows.Elton John's 1973 album Don't Shoot Me I'm Only the Piano Player features a song titled "Elderberry Wine".
- In Monty Python and the Holy Grail, John Cleese as the French Taunter tells the knights of Camelot, "Your mother was a hamster, and your father smelt of elderberries."
+ In Monty Python and the Holy Grail, John Cleese as the French Taunter tells the knights of Camelot, "Your mother was a hamster, and your father smelt of elderberries."
Gallery
diff --git a/exp.recommanded/__pycache__/app.cpython-38.pyc b/exp.recommanded/__pycache__/app.cpython-38.pyc
new file mode 100644
index 0000000..f88e141
Binary files /dev/null and b/exp.recommanded/__pycache__/app.cpython-38.pyc differ
diff --git a/exp.recommanded/app.py b/exp.recommanded/app.py
new file mode 100644
index 0000000..ffd1d82
--- /dev/null
+++ b/exp.recommanded/app.py
@@ -0,0 +1,124 @@
+from flask import Flask
+from flask import request, render_template
+from markdown import markdown
+import sys
+
+app = Flask("recommend")
+
+# appending a path
+sys.path.append('../')
+
+# importing customised module
+import summa.edits
+from summa.edits import scored_sentences, similarity_graph
+
+import wikipage
+from wikipage.page import get_wikipage
+
+context = {
+ 'page_name' : "door",
+ 'page' : None,
+ 'graph' : None,
+ 'sentences' : None,
+ 'current_sentence' : None
+}
+
+# TextRank
+# ------------------------------------------------------------------------
+
+
+def get_similar_sentences(s0, sentences, graph):
+ # return a list of all the sentences ordered by similarity to s0
+ similar_sentences = sorted(sentences, key=lambda s: graph.edge_weight((s0.token, s.token)), reverse=True)
+ return similar_sentences
+
+
+# main
+# ------------------------------------------------------------------------
+
+def new_page(page_name):
+ # from a pagename get
+ # 1. get the page text
+ # 2. graph and scored sentences
+
+ # --- WIKI REQUEST ---
+
+ # get text from wikipedia
+ print('--- WIKI ---')
+ context['page'] = get_wikipage(page_name)
+ if not context['page']:
+ sys.exit("--- STOP ---")
+ text = context['page'].content
+
+ # print text in terminal
+ print('--- TXT ---')
+ print(text)
+
+ # --- APPLY TEXTRANK ---
+
+ # apply textrank
+ context['sentences'] = scored_sentences(text)
+ context['graph'] = similarity_graph(text)
+
+
+@app.route("/")
+def index():
+
+ if 'token' in request.args:
+ token = request.args['token']
+ context['current_sentence'] = [s for s in context['sentences'] if s.token == token][0]
+
+ else:
+ new_page(context['page_name'])
+ sorted_sentences = sorted(context['sentences'], key=lambda s: s.score, reverse=True)
+ best_sentence = sorted_sentences[0]
+
+ print("--- START/BEST ---")
+ print(best_sentence.text)
+
+ context['current_sentence'] = best_sentence
+
+ # sentences ordered by similarity to the best one
+ similar_sentences = get_similar_sentences(context['current_sentence'] , context['sentences'], context['graph'])
+
+ current_sentence=context['current_sentence']
+ return render_template('index.html', current_sentence=current_sentence , similar_sentences=similar_sentences)
+
+
+ # # --- APPLY TEXTRANK ---
+
+ # # apply textrank
+ # sentences = scored_sentences(text)
+ # graph = similarity_graph(text)
+
+ # # print ranked sentences in terminal
+ # print('--- GRAPH ---')
+
+ # # notes:
+ # # * the matrix/graph does not contain the sentences but their .token
+
+ # sorted_sentences = sorted(sentences, key=lambda s: s.score, reverse=True)
+ # best_sentence = sorted_sentences[0]
+
+ # print("START/BEST: \n")
+ # print(best_sentence.text + "\n")
+
+ # # sentences ordered by similarity to the best one
+ # similar_sentences = similar_sentences(best_sentence, sentences, graph)
+
+ # for i in range(len(similar_sentences)):
+ # print(str(i) + ". " + similar_sentences[i].text)
+
+
+ # # for s1 in sentences:
+ # # for s2 in sentences:
+
+ # # if s1 != s2:
+ # # if graph.has_node(s1.token) and graph.has_node(s2.token):
+
+ # # weight = graph.edge_weight((s1.token, s2.token))
+
+ # # print('---')
+ # # print('1. ' + s1.text)
+ # # print('2. ' + s2.text)
+ # # print('similarity: ' + str(weight))
diff --git a/exp.recommanded/make.py b/exp.recommanded/make.py
deleted file mode 100644
index d928084..0000000
--- a/exp.recommanded/make.py
+++ /dev/null
@@ -1,56 +0,0 @@
-from jinja2 import Template
-from markdown import markdown
-import sys
-
-# appending a path
-sys.path.append('../')
-
-# importing customised module
-import summa.edits
-from summa.edits import scored_sentences, similarity_graph
-
-import wikipage
-from wikipage.page import get_wikipage
-
-wikipedia_page = "mushroom"
-
-# main
-# ------------------------------------------------------------------------
-
-if __name__ == '__main__':
-
- # --- WIKI REQUEST ---
-
- # get text from wikipedia
- print('--- WIKI ---')
- page = get_wikipage(wikipedia_page)
- if not page:
- sys.exit("--- STOP ---")
- title = '