ruletagger 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. data/COPYING +21 -0
  2. data/History.txt +4 -0
  3. data/LICENSE +21 -0
  4. data/License.txt +20 -0
  5. data/Manifest.txt +75 -0
  6. data/PostInstall.txt +7 -0
  7. data/README +7 -0
  8. data/README.txt +53 -0
  9. data/Rakefile +33 -0
  10. data/config/hoe.rb +75 -0
  11. data/config/requirements.rb +15 -0
  12. data/ext/rule_tagger/bool.h +38 -0
  13. data/ext/rule_tagger/darray.c +292 -0
  14. data/ext/rule_tagger/darray.h +125 -0
  15. data/ext/rule_tagger/darrayP.h +50 -0
  16. data/ext/rule_tagger/extconf.rb +14 -0
  17. data/ext/rule_tagger/lex.c +170 -0
  18. data/ext/rule_tagger/lex.h +49 -0
  19. data/ext/rule_tagger/memory.c +127 -0
  20. data/ext/rule_tagger/memory.h +20 -0
  21. data/ext/rule_tagger/rbtagger.c +252 -0
  22. data/ext/rule_tagger/registry.c +326 -0
  23. data/ext/rule_tagger/registry.h +129 -0
  24. data/ext/rule_tagger/registryP.h +46 -0
  25. data/ext/rule_tagger/ruby-compat.h +20 -0
  26. data/ext/rule_tagger/rules.c +525 -0
  27. data/ext/rule_tagger/rules.h +42 -0
  28. data/ext/rule_tagger/sysdep.h +20 -0
  29. data/ext/rule_tagger/tagger.c +110 -0
  30. data/ext/rule_tagger/tagger.h +46 -0
  31. data/ext/rule_tagger/useful.c +44 -0
  32. data/ext/rule_tagger/useful.h +51 -0
  33. data/ext/word_tagger/extconf.rb +7 -0
  34. data/ext/word_tagger/porter_stemmer.c +430 -0
  35. data/ext/word_tagger/porter_stemmer.h +19 -0
  36. data/ext/word_tagger/rtagger.cc +83 -0
  37. data/ext/word_tagger/tagger.cc +153 -0
  38. data/ext/word_tagger/tagger.h +27 -0
  39. data/ext/word_tagger/tagger.rb +8 -0
  40. data/ext/word_tagger/test/Makefile +22 -0
  41. data/ext/word_tagger/test/doc.txt +87 -0
  42. data/ext/word_tagger/test/test.cc +107 -0
  43. data/ext/word_tagger/test.rb +31 -0
  44. data/lib/brill/tagger.rb +225 -0
  45. data/lib/rbtagger/version.rb +9 -0
  46. data/lib/rbtagger.rb +6 -0
  47. data/script/console +10 -0
  48. data/script/destroy +14 -0
  49. data/script/generate +14 -0
  50. data/script/txt2html +82 -0
  51. data/setup.rb +1585 -0
  52. data/tasks/deployment.rake +34 -0
  53. data/tasks/environment.rake +7 -0
  54. data/tasks/website.rake +17 -0
  55. data/test/CONTEXTUALRULEFILE +284 -0
  56. data/test/LEXICALRULEFILE +148 -0
  57. data/test/LEXICON +93696 -0
  58. data/test/docs/doc0.txt +20 -0
  59. data/test/docs/doc1.txt +11 -0
  60. data/test/docs/doc2.txt +52 -0
  61. data/test/docs/doc3.txt +128 -0
  62. data/test/docs/doc4.txt +337 -0
  63. data/test/docs/doc5.txt +497 -0
  64. data/test/docs/doc6.txt +116 -0
  65. data/test/docs/doc7.txt +101 -0
  66. data/test/docs/doc8.txt +25 -0
  67. data/test/docs/doc9.txt +84 -0
  68. data/test/tagger_test.rb +60 -0
  69. data/test/test_helper.rb +2 -0
  70. data/tools/rakehelp.rb +113 -0
  71. data/website/index.html +113 -0
  72. data/website/index.txt +53 -0
  73. data/website/javascripts/rounded_corners_lite.inc.js +285 -0
  74. data/website/stylesheets/screen.css +138 -0
  75. data/website/template.html.erb +48 -0
  76. metadata +155 -0
@@ -0,0 +1,101 @@
1
+ What is a stem cell transplant?
2
+
3
+ Most stem cells are in your bone marrow . You also have some in your blood that circulate from your bone marrow. Bone marrow stem cells turn into red blood cells , white blood cells , or platelets to help your body stay healthy. If your bone marrow is attacked by a disease such as leukemia, it can no longer make normal blood cells. In a stem cell transplant, healthy stem cells are placed in your body through an IV to help your bone marrow start to work right.
4
+
5
+ When the stem cells come from your own blood or bone marrow, it is called an autologous transplant.
6
+
7
+ When the stem cells come from another person, it is called an allogeneic transplant . The donor may be a relative or a complete stranger. The important thing is that the donor's blood is closely matched to yours. This is most likely when the donor is your brother or sister.
8
+
9
+ Stem cells can also be found in your bloodstream and in the blood inside a newborn's umbilical cord .
10
+
11
+ When is a stem cell transplant needed?
12
+
13
+ Stem cell transplants are used to:
14
+
15
+ Treat diseases that damage or destroy the bone marrow. Such diseases include non-Hodgkin's lymphoma and Hodgkin's lymphoma , leukemia , multiple myeloma , and aplastic anemia .
16
+ Restore bone marrow that has been damaged by total body radiation and high doses of chemotherapy used for cancer treatment.
17
+ Other uses for stem cells are being studied, such as the treatment of diabetes , Parkinson's disease , sickle cell disease , and thalassemia .
18
+
19
+ How do I know if I am a good candidate for a stem cell transplant?
20
+
21
+ Your doctor will consider your overall health and your age. People who are good candidates usually are younger than 70, do not have other diseases such as heart disease or diabetes, and have a normal kidney and liver. Your doctor will also consider how much your disease has grown and how aggressive your cancer is. People with aggressive cancer that has spread to many areas of the body are not usually thought to be good candidates. Your doctor may also consider whether you have cancer that has come back, such as relapsed non-Hodgkin's lymphoma .
22
+
23
+ How are stem cells collected?
24
+
25
+ It depends on where the stem cells come from. If they are taken from the bone marrow, a small amount of the liquid portion of the bone marrow is removed through a needle inserted into the bone. This is done many times to collect enough stem cells for the person getting the donated bone marrow. This is called a bone marrow aspiration . The bone marrow cells are put in a blood bag. They are often frozen for future use.
26
+
27
+ If they are taken from blood, the growth factor G-CSF may be used to stimulate the growth of new stem cells so they spill over into the blood. G-CSF is a protein that is produced naturally in the body. G-CSF may be used so a transplant can be done as soon as possible and a chemotherapy dose does not have to be lower to allow stem cells to grow. The blood is removed from the vein in one arm and passed through a machine that separates the stem cells. The machine then returns the remaining blood through a needle in the person's other arm. This is called apheresis .
28
+
29
+ In adults, most autologous transplants use stem cells from blood. In a child, the decision whether to use cells from the bone marrow or the blood depends on the size of the child.
30
+
31
+ Why are chemotherapy and radiation therapy used before a transplant?
32
+
33
+ Before you have chemotherapy and radiation, you have blood taken and stored (banked) for later. Then you have chemotherapy and radiation to destroy the diseased cells in your bone marrow. This gets rid of the cancer cells in your bone marrow. Later, when you get your stored blood cells back, those new cells will be able to take over the job of making new blood cells.
34
+
35
+ How are stem cells transplanted?
36
+
37
+ An IV is inserted in your neck or chest. The stem cells travel from the blood bag through the IV, into your blood, and to your bone marrow, where they will begin to produce new cells in 1 to 3 weeks. During this time:
38
+
39
+ You will be in isolation and given antibiotics to prevent or to treat infection. Destroying your bone marrow cells with chemotherapy leaves your body unable to fight infection.
40
+ Your blood will be tested often to check the levels of red blood cells, white blood cells, and platelets in your body.
41
+ You may need to receive several transfusions of blood cells and platelets until your body begins to produce its own.
42
+ You may need more antibiotics or other medicines if you get an infection.
43
+ What To Expect After Treatment
44
+
45
+ An autologous transplant usually causes fewer problems than an allogeneic transplant. Some people are able to receive part or even all of their treatment in an outpatient clinic. Even if you need to be in a hospital, you will not usually have to stay longer than 3 weeks.
46
+
47
+ Severe, often life-threatening infection can develop after a stem cell transplant. You will need to take antibiotics for several months to prevent infection.
48
+
49
+ Your immune system may take 1 to 2 years or longer to recover after a transplant. Bone marrow aspiration or biopsy is used to check your bone marrow. You will need to have many immunizations updated. Check with your doctor to find out which immunizations you will need.
50
+
51
+ Why It Is Done
52
+
53
+ Autologous stem cell transplant is used:
54
+
55
+ After high doses of chemotherapy for killing cancer cells, that have also destroyed your bone marrow. The stem cell transplant gives you back your normal bone marrow.
56
+ To treat diseases that damage the bone marrow, such as Hodgkin's lymphoma , non-Hodgkin's lymphoma , and multiple myeloma .
57
+ Experimentally (and rarely) to treat solid tumors, such as breast cancer or testicular cancer . It is also used to treat tumors that develop from cells producing eggs or sperm (germ cell tumors), such as dysgerminomas and teratomas.
58
+ Experimentally for gene therapy and the treatment of other diseases, such as diabetes .
59
+ How Well It Works
60
+
61
+ The success of a transplant depends on the type and stage of the disease and your age and general health.
62
+
63
+ The original disease may come back after the transplant. If relapse occurs after autologous transplant, chemotherapy or other treatments may be used.
64
+
65
+ Risks
66
+
67
+ Early complications usually occur within 5 to 10 days and include:
68
+
69
+ Nausea and vomiting.
70
+ Diarrhea.
71
+ Mouth sores.
72
+ Hair loss.
73
+ Bleeding because of severe reduction in red blood cells, white blood cells, and platelets.
74
+ Infection, such as pneumonia , shingles , or herpes simplex .
75
+ Other possible complications include:
76
+
77
+ Depression.
78
+ Infertility .
79
+ Cataracts .
80
+ Kidney, lung, and heart complications.
81
+ Recurrence of your cancer.
82
+ Other types of cancer later in life.
83
+ What To Think About
84
+
85
+ Transplants from your own marrow
86
+
87
+ Using your own stem cells in a transplant is safer than using someone else's, because your body will not reject your own stem cells. But it also means you are more likely to have a relapse.1 That is because your own marrow or blood may still contain some of the cancer cells you are trying to get rid of. Cells from another donor may work better at attacking any leftover cancer cells still in your body.
88
+
89
+ Some studies show that treating your marrow or blood with certain drugs before it is put back into your body may increase your chances for getting better. These drugs are given to try to kill any cancer cells that may still be around. Treating your marrow or blood in this way is called purging. Researchers are still studying whether purging is really helpful.1
90
+
91
+ Specialized hospitals
92
+
93
+ Not every hospital is able to perform transplants. You may have to travel to a hospital that has special equipment and specially trained doctors and nurses. Transplants are very expensive and are not always covered by insurance.
94
+
95
+ Complete the special treatment information form (PDF) (What is a PDF document?) to help you understand this treatment.
96
+
97
+ References
98
+
99
+ Citations
100
+
101
+ Greer JP, et al. (2004). Acute myeloid leukemia in adults. In JP Greer et al., eds., Wintrobe's Clinical Hematology, 11th ed., vol. 2, pp. 2097a2142. Baltimore: Williams and Wilkins.
@@ -0,0 +1,25 @@
1
+ I seem to be salivating more than usual. I feel like I constantly have to swallow and wipe the corners of my mouth. I am 60 years old and otherwise in good health. What causes excessive saliva?
2
+
3
+ No name, No state given
4
+
5
+ Excessive saliva is usually a temporary problem and rarely a cause for concern.
6
+
7
+ Normally, your salivary glands produce 1 to 2 quarts (0.95 to 1.89 liters) of saliva a day. However, because swallowing occurs continually and unconsciously, you don't generally notice the saliva. If you suddenly seem to have excessive saliva in your mouth, it may be because your salivary glands are making more saliva than usual (sialorrhea) or because you are swallowing less often.
8
+
9
+ Causes of increased saliva production include:
10
+
11
+ Pregnancy
12
+ New dentures
13
+ Inflammation of mucous membranes of the mouth (stomatitis)
14
+ A side effect of certain medications, such as clozapine, isoproterenol, pilocarpine and reserpine
15
+ Damage to the nerves that control the salivary glands
16
+ Causes of a decreased ability to swallow or to retain saliva in your mouth include:
17
+
18
+ Neurological disorders, such as Parkinson's disease or cerebral palsy
19
+ Nasal obstruction, such as due to allergies, sinus infection, nasal polyps and enlarged adenoids
20
+ Gastroesophageal reflux
21
+ Sjogren's syndrome
22
+ Bell's palsy
23
+ If you're concerned about excessive salivation, consult your doctor or dentist. It's important to determine if the problem is due to increased saliva production or a decreased ability to swallow.
24
+
25
+ Treatment of persistent, excessive salivation is directed at the underlying cause, if possible. Anticholinergic medications, such as transdermal scopolamine, can be used to decrease saliva. Although anticholinergics may help in severe cases of drooling, these medications aren't always effective and can cause side effects.
@@ -0,0 +1,84 @@
1
+ If you're an older adult, you may have dismissed trembling hands or a shaking head as a normal part of the aging process. But it's more likely your shakiness is a sign of a movement disorder called essential tremor.
2
+
3
+ Although essential tremor can affect almost any part of your body, trembling occurs most often in your hands, especially when you try to do simple tasks such as drinking a glass of water, tying your shoelaces, writing or shaving. Sometimes, you may also have trembling of your head, voice or arms.
4
+
5
+ Essential tremor is the most common of the many movement disorders. It's far more common than Parkinson's disease, with which it may sometimes be confused. Unlike Parkinson's disease, however, essential tremor doesn't lead to serious complications. In fact, the word "essential" in essential tremor means the disorder isn't linked to other diseases.
6
+
7
+ For some people, essential tremor may be distressing but not debilitating. Others may find that their tremors make it difficult to work, perform everyday tasks that require fine-motor skills or do the things they enjoy. Severe tremors can lead to social withdrawal and isolation. Fortunately, a variety of treatments exist that may help bring your tremors under control.
8
+
9
+ Signs and symptoms
10
+
11
+ Essential tremor often begins gradually. Sometimes it appears during adolescence. More often, though, tremors begin in mid- to late life.
12
+
13
+ The most common sign is a trembling, up-and-down movement of your hands, although your arms, legs, head and even your tongue and voice box (larynx) also may be affected. Most people have tremors in both hands. Some people have tremors in only one hand, though the tremors often progress to include both hands.
14
+
15
+ Tremors usually occur only when you engage in a voluntary movement, such as drinking a glass of water, writing or threading a needle. Actions requiring fine-motor skills - using utensils or small tools, for example - may be especially difficult. Fatigue, anxiety and temperature extremes make the signs worse, but tremors usually disappear when you're asleep or at rest.
16
+
17
+ Some people have relatively mild tremors throughout their lives, while others develop more severe tremors and increased disability over time. Effects of worsening tremors may include:
18
+
19
+ Difficulty holding a cup or glass without spilling
20
+ Difficulty eating normally
21
+ Difficulty putting on makeup or shaving
22
+ Difficulty talking, if your voice box or tongue is affected
23
+ Difficulty writing - handwriting may become increasingly large, shaky and illegible
24
+ The inability to perform actions requiring fine-motor skills, such as playing an instrument or drawing
25
+ Essential tremor vs. Parkinson's disease
26
+ Many people associate tremors with Parkinson's disease, a serious movement disorder. But essential tremor and Parkinson's disease aren't related, and the two conditions differ in key ways:
27
+
28
+ When tremors occur. Essential tremor of the hands typically occurs when your hands are in use. Tremors from Parkinson's are most prominent when your hands are at your sides or resting in your lap. This type of tremor usually decreases with movement of the hands.
29
+ Associated conditions. Essential tremor doesn't cause other health problems, whereas Parkinson's is associated with a stooped posture, slow movement, a shuffling gait, speech problems other than tremor and sometimes memory loss.
30
+ Parts of body affected. Essential tremor can involve your hands, legs, head and voice. Tremors from Parkinson's typically affect your hands, but not your head or voice.
31
+ Causes
32
+
33
+ About half of all cases of essential tremor appear to occur because of a genetic mutation. This is referred to as benign familial tremor. Genes are information centers in your cells that control your body's growth, development and function. A mutation in just one gene can greatly alter the way your body works. Researchers have identified two genes that appear to be involved in essential tremor. It's possible that mutations in other genes may also lead to the condition.
34
+
35
+ Exactly what causes essential tremor in people without a known genetic mutation isn't clear. Doctors do know that the problem occurs in the brain circuits that control your movements. Studies using an imaging technique called positron emission tomography (PET) scanning show that certain parts of the brain - including the thalamus - have increased activity in people with essential tremor. More research is needed to understand the precise mechanism behind the disease.
36
+
37
+ Risk factors
38
+
39
+ Benign familial tremors are an autosomal dominant disorder, which means that a defective gene from just one parent is needed to pass on the condition. If you have a parent with a genetic mutation for essential tremor, you have a 50 percent chance of developing the disorder yourself. The only other known risk factor is older age. Although essential tremor can affect people of all ages, it usually appears in late middle age or later.
40
+
41
+
42
+
43
+ When to seek medical advice
44
+
45
+ See your doctor if tremors make it hard to perform daily activities or prevent you from living your life as fully as you'd like. Your doctor can determine whether essential tremor is causing your problem and may be able to suggest treatments that will ease your symptoms.
46
+
47
+ Screening and diagnosis
48
+
49
+ You'll receive a diagnosis of essential tremor only after your doctor has ruled out other possible causes for your symptoms. For that reason, you may undergo blood, urine and neurological tests to check for problems such as thyroid disease, heavy metal poisoning, drug side effects and Parkinson's disease.
50
+
51
+ In addition, your doctor will take a complete medical history and perform a thorough physical and neurological exam that may include checking your tendon reflexes, your muscle strength and tone, your ability to feel certain sensations, and your posture and coordination.
52
+
53
+ The tremor itself may be evaluated in several ways, including performance tests in which you're asked to write, drink from a glass or hold a piece of paper.
54
+
55
+
56
+
57
+ Treatment
58
+
59
+ Most people with essential tremor don't need treatment beyond reassurance that the condition isn't a sign of a more serious disease. Lifestyle changes - which include getting plenty of rest and avoiding stressful situations and stimulants such as caffeine - may help ease the tremors. Most people with essential tremor find that fatigue, anxiety, sleep deprivation and even temperature extremes make their tremors worse.
60
+
61
+ If lifestyle changes don't help and tremors are keeping you from doing the things you enjoy, your doctor may recommend these options:
62
+
63
+ Medications
64
+ Medications provide relief from tremors roughly half the time. They include:
65
+
66
+ Beta blockers. Normally used to treat high blood pressure, beta blockers, such as propranolol (Inderal), help relieve tremors in some people. Because beta blockers are especially likely to cause dizziness, confusion and memory loss in older adults, they may be a better choice for younger people. They may not be an option if you also have asthma, diabetes or certain heart problems.
67
+ Anti-seizure medications. These drugs, especially primidone (Mysoline), may be effective in people who don't respond to beta blockers. The main side effects are drowsiness and flu-like symptoms, which usually disappear within a short time.
68
+ Tranquilizers. Doctors sometimes use drugs such as diazepam (Valium) and alprazolam (Xanax) to treat people whose tremors are made much worse by tension or anxiety. Side effects can include confusion and memory loss. Additionally, these medications should be used with caution because they can be habit-forming.
69
+ Botulinum toxin type A (Botox) injections. You're probably familiar with Botox as a treatment for facial wrinkles, but it can also be useful in treating some types of tremors, especially of the head and voice. Botox injections can improve problems for up to three months at a time. When used to treat hand tremors, Botox can sometimes cause weakness in your fingers.
70
+ Surgery
71
+ Surgery may be an option for people whose tremors are severely disabling and who don't respond to medications. Deep brain stimulation (DBS) is a treatment involving a brain implant device called a thalamic stimulator may be appropriate if you have severe tremors and if medications aren't effective. A pacemaker-like chest unit transmits electrical pulses through a wire to a lead implanted in your thalamus. The pulses, which are painless, may interrupt signals from your thalamus that help cause tremors. You turn the pulse generator on and off by passing a magnet over your chest.
72
+
73
+
74
+
75
+ Self-care
76
+
77
+ The following suggestions can sometimes help reduce or relieve tremors:
78
+
79
+ Avoid caffeine. Caffeine can cause your body to produce more adrenaline, which may make your tremors worse. Avoid other stimulants as well.
80
+ Use alcohol sparingly. Some people notice that their tremors improve for up to an hour after they drink alcohol, but drinking isn't a good solution for people with essential tremor. That's because tremors tend to worsen once the effects of alcohol wear off. What's more, larger amounts of alcohol eventually are needed to relieve tremors, which can lead to chronic alcoholism. If you have essential tremor, it's best to drink sparingly or not at all.
81
+ Learn to relax. Stress tends to make tremors worse, and a relaxed state often improves them. Although it's not possible to eliminate all stress from your life, you can change how you react to stressful situations using a range of relaxation techniques. These include deep breathing, progressive muscle relaxation, guided imagery and massage as well as disciplines such as yoga and tai chi. Many people also find that physical exercise - walking, jogging, swimming or biking - is a great stress reliever.
82
+ Rest well. Fatigue can exacerbate tremors. Try to get at least seven hours of sound sleep every night. If you have trouble falling asleep, wake up repeatedly or awaken early and can't go back to sleep, talk to your doctor.
83
+ Strengthen your hands. Your doctor may recommend working with a specialist to learn exercises to promote more stability in your hands and wrists. These usually involve using 1- to 2-pound weights strapped to your wrists. You can continue doing these exercises at home.
84
+ Consider joining a support group. For many people, essential tremor can have serious social and psychological consequences. If the effects of essential tremor are making it hard to live your life as fully as you once did, consider joining a support group for people with the disorder. Support groups aren't for everyone, but you may find it helpful to have the encouragement of people who understand what you're going through. Or you might want to consider seeing a counselor or social worker who can help you meet the challenges of living with essential tremor.
@@ -0,0 +1,60 @@
1
+ require 'test/unit'
2
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
+ $:.unshift File.join(File.dirname(__FILE__), "..", "ext", "rule_tagger")
4
+
5
+ require 'brill/tagger'
6
+
7
+ puts "loading tagger..."
8
+ $tagger = Brill::Tagger.new( File.join(File.dirname(__FILE__),"LEXICON"),
9
+ File.join(File.dirname(__FILE__),"LEXICALRULEFILE"),
10
+ File.join(File.dirname(__FILE__),"CONTEXTUALRULEFILE") )
11
+ puts "tagger loaded!"
12
+
13
+ class TaggerTest < Test::Unit::TestCase
14
+ SAMPLE_DOC=%q(
15
+ Take an active role in your care
16
+ When it comes to making decisions about the goals and direction of treatment, don't sit back. Work closely and actively with your oncologist and the rest of your medical team.
17
+ Dont overlook clinical trials
18
+ If youre eligible to enroll in clinical trials, select an oncologist who participates in them. Patients who enroll in clinical studies receive closer follow-up, the highest standard-of-care treatment and access to experimental therapies at no extra cost.
19
+ Maximize your nutrition strategy
20
+ Doing your best to eat a healthy, well-balanced diet is vital to prompt healing after surgery and for recovery from radiation or chemotherapy. Many oncology practices employ registered dieticians who can help you optimize your nutrition.
21
+ Steer clear of "natural cures"
22
+ Before trying nutritional supplements or herbal remedies, be sure to discuss your plans with a doctor. Most have not been tested in clinical studies, and some may actually interfere with your treatment.
23
+ Build a stronger body
24
+ Even walking regularly is can help you minimize long-term muscle weakness caused by illness or de-conditioning.
25
+ Focus on overall health
26
+ Patients may be cured of cancer but still face life-threatening medical problems that are underemphasized during cancer treatments, such as diabetes, high blood pressure and heart disease. Continue to monitor your overall health.
27
+ Put the fire out for good
28
+ Smoking impairs healing after surgery and radiation and increases your risk of cardiovascular disease and many types of cancers. Ask your doctor for help identifying and obtaining the most appropriate cessation aids.
29
+ Map a healthy future
30
+ Once youve completed treatment, discuss appropriate follow-up plans with your doctor and keep track of them yourself. Intensified screening over many years is frequently recommended to identify and treat a recurrence early on.
31
+ Share your feelings
32
+ Allow yourself time to discuss the emotional consequences of your illness and treatment with family, friends, your doctor and, if necessary, a professional therapist. Many patients also find antidepressants helpful during treatment.
33
+ Stay connected
34
+ Although many newly diagnosed patients fear they will not be able to keep working during treatment, this is usually not the case. Working, even at a reduced schedule, helps you maintain valuable social connections and weekly structure.
35
+ )
36
+ def test_simple_tagger
37
+ pairs = tagger.tag( SAMPLE_DOC )
38
+ assert_equal [["", ")"], ["", ")"], ["Take", "VB"], ["an", "DT"], ["active", "JJ"], ["role", "NN"], ["in", "IN"], ["your", "PRP$"], ["care", "NN"], ["When", "WRB"], ["it", "PRP"], ["comes", "VBZ"], ["to", "TO"], ["making", "VBG"], ["decisions", "NNS"], ["about", "IN"], ["the", "DT"], ["goals", "NNS"], ["and", "CC"], ["direction", "NN"], ["of", "IN"], ["treatment", "NN"], [",", ","], ["", ")"], ["do", "VBP"], ["", ")"], ["n't", "RB"], ["sit", "VB"], ["back.", "CD"], ["Work", "NN"], ["closely", "RB"], ["and", "CC"], ["actively", "RB"], ["with", "IN"], ["your", "PRP$"], ["oncologist", "NN"], ["and", "CC"], ["the", "DT"], ["rest", "NN"], ["of", "IN"], ["your", "PRP$"], ["medical", "JJ"], ["team.", "NNP"], ["Dont", "NNP"], ["overlook", "VB"], ["clinical", "JJ"], ["trials", "NNS"], ["If", "IN"], ["youre", "NN"], ["eligible", "JJ"], ["to", "TO"], ["enroll", "VB"], ["in", "IN"], ["clinical", "JJ"], ["trials", "NNS"], [",", ","], ["", ")"], ["select", "VB"], ["an", "DT"], ["oncologist", "NN"], ["who", "WP"], ["participates", "VBZ"], ["in", "IN"], ["them.", "JJ"], ["Patients", "NNS"], ["who", "WP"], ["enroll", "VBP"], ["in", "IN"], ["clinical", "JJ"], ["studies", "NNS"], ["receive", "VBP"], ["closer", "JJR"], ["follow-up", "NN"], [",", ","], ["", ")"], ["the", "DT"], ["highest", "JJS"], ["standard-of-care", "JJ"], ["treatment", "NN"], ["and", "CC"], ["access", "NN"], ["to", "TO"], ["experimental", "JJ"], ["therapies", "NNS"], ["at", "IN"], ["no", "DT"], ["extra", "JJ"], ["cost.", "NNP"], ["Maximize", "NNP"], ["your", "PRP$"], ["nutrition", "NN"], ["strategy", "NN"], ["Doing", "NNP"], ["your", "PRP$"], ["best", "JJS"], ["to", "TO"], ["eat", "VB"], ["a", "DT"], ["healthy", "JJ"], [",", ","], ["", ")"], ["well-balanced", "JJ"], ["diet", "NN"], ["is", "VBZ"], ["vital", "JJ"], ["to", "TO"], ["prompt", "VB"], ["healing", "NN"], ["after", "IN"], ["surgery", "NN"], ["and", "CC"], ["for", "IN"], ["recovery", "NN"], ["from", "IN"], ["radiation", "NN"], ["or", "CC"], ["chemotherapy.", "JJ"], ["Many", "JJ"], ["oncology", "NN"], ["practices", "NNS"], ["employ", "VBP"], ["registered", "VBN"], ["dieticians", "NNS"], ["who", "WP"], ["can", "MD"], ["help", "VB"], ["you", "PRP"], ["optimize", "VB"], ["your", "PRP$"], ["nutrition.", "JJ"], ["Steer", "VB"], ["clear", "JJ"], ["of", "IN"], ["", ")"], ["``", "``"], ["natural", "JJ"], ["cures", "NNS"], ["''", "''"], ["", ")"], ["Before", "IN"], ["trying", "VBG"], ["nutritional", "JJ"], ["supplements", "NNS"], ["or", "CC"], ["herbal", "JJ"], ["remedies", "NNS"], [",", ","], ["", ")"], ["be", "VB"], ["sure", "JJ"], ["to", "TO"], ["discuss", "VB"], ["your", "PRP$"], ["plans", "NNS"], ["with", "IN"], ["a", "DT"], ["doctor.", "JJ"], ["Most", "JJS"], ["have", "VBP"], ["not", "RB"], ["been", "VBN"], ["tested", "VBN"], ["in", "IN"], ["clinical", "JJ"], ["studies", "NNS"], [",", ","], ["", ")"], ["and", "CC"], ["some", "DT"], ["may", "MD"], ["actually", "RB"], ["interfere", "VB"], ["with", "IN"], ["your", "PRP$"], ["treatment.", "JJ"], ["Build", "VB"], ["a", "DT"], ["stronger", "JJR"], ["body", "NN"], ["Even", "RB"], ["walking", "VBG"], ["regularly", "RB"], ["is", "VBZ"], ["can", "MD"], ["help", "VB"], ["you", "PRP"], ["minimize", "VB"], ["long-term", "JJ"], ["muscle", "NN"], ["weakness", "NN"], ["caused", "VBN"], ["by", "IN"], ["illness", "NN"], ["or", "CC"], ["de-conditioning.", "NNP"], ["Focus", "NNP"], ["on", "IN"], ["overall", "JJ"], ["health", "NN"], ["Patients", "NNS"], ["may", "MD"], ["be", "VB"], ["cured", "VBN"], ["of", "IN"], ["cancer", "NN"], ["but", "CC"], ["still", "JJ"], ["face", "NN"], ["life-threatening", "JJ"], ["medical", "JJ"], ["problems", "NNS"], ["that", "WDT"], ["are", "VBP"], ["underemphasized", "JJ"], ["during", "IN"], ["cancer", "NN"], ["treatments", "NNS"], [",", ","], ["", ")"], ["such", "JJ"], ["as", "IN"], ["diabetes", "NN"], [",", ","], ["", ")"], ["high", "JJ"], ["blood", "NN"], ["pressure", "NN"], ["and", "CC"], ["heart", "NN"], ["disease.", "JJ"], ["Continue", "VB"], ["to", "TO"], ["monitor", "VB"], ["your", "PRP$"], ["overall", "JJ"], ["health.", "JJ"], ["Put", "NN"], ["the", "DT"], ["fire", "NN"], ["out", "IN"], ["for", "IN"], ["good", "JJ"], ["Smoking", "NNP"], ["impairs", "NNS"], ["healing", "NN"], ["after", "IN"], ["surgery", "NN"], ["and", "CC"], ["radiation", "NN"], ["and", "CC"], ["increases", "NNS"], ["your", "PRP$"], ["risk", "NN"], ["of", "IN"], ["cardiovascular", "JJ"], ["disease", "NN"], ["and", "CC"], ["many", "JJ"], ["types", "NNS"], ["of", "IN"], ["cancers.", "CD"], ["Ask", "VB"], ["your", "PRP$"], ["doctor", "NN"], ["for", "IN"], ["help", "NN"], ["identifying", "VBG"], ["and", "CC"], ["obtaining", "VBG"], ["the", "DT"], ["most", "RBS"], ["appropriate", "JJ"], ["cessation", "NN"], ["aids.", "NNP"], ["Map", "NNP"], ["a", "DT"], ["healthy", "JJ"], ["future", "NN"], ["Once", "RB"], ["youve", "VBP"], ["completed", "VBN"], ["treatment", "NN"], [",", ","], ["", ")"], ["discuss", "VB"], ["appropriate", "JJ"], ["follow-up", "NN"], ["plans", "NNS"], ["with", "IN"], ["your", "PRP$"], ["doctor", "NN"], ["and", "CC"], ["keep", "VB"], ["track", "NN"], ["of", "IN"], ["them", "PRP"], ["yourself.", "CD"], ["Intensified", "JJ"], ["screening", "NN"], ["over", "IN"], ["many", "JJ"], ["years", "NNS"], ["is", "VBZ"], ["frequently", "RB"], ["recommended", "VBN"], ["to", "TO"], ["identify", "VB"], ["and", "CC"], ["treat", "VB"], ["a", "DT"], ["recurrence", "NN"], ["early", "JJ"], ["on.", "CD"], ["Share", "VB"], ["your", "PRP$"], ["feelings", "NNS"], ["Allow", "VB"], ["yourself", "PRP"], ["time", "NN"], ["to", "TO"], ["discuss", "VB"], ["the", "DT"], ["emotional", "JJ"], ["consequences", "NNS"], ["of", "IN"], ["your", "PRP$"], ["illness", "NN"], ["and", "CC"], ["treatment", "NN"], ["with", "IN"], ["family", "NN"], [",", ","], ["", ")"], ["friends", "NNS"], [",", ","], ["", ")"], ["your", "PRP$"], ["doctor", "NN"], ["and", "CC"], [",", ","], ["", ")"], ["if", "IN"], ["necessary", "JJ"], [",", ","], ["", ")"], ["a", "DT"], ["professional", "JJ"], ["therapist.", "JJ"], ["Many", "JJ"], ["patients", "NNS"], ["also", "RB"], ["find", "VBP"], ["antidepressants", "NNS"], ["helpful", "JJ"], ["during", "IN"], ["treatment.", "JJ"], ["Stay", "VB"], ["connected", "VBN"], ["Although", "IN"], ["many", "JJ"], ["newly", "RB"], ["diagnosed", "VBN"], ["patients", "NNS"], ["fear", "VBP"], ["they", "PRP"], ["will", "MD"], ["not", "RB"], ["be", "VB"], ["able", "JJ"], ["to", "TO"], ["keep", "VB"], ["working", "VBG"], ["during", "IN"], ["treatment", "NN"], [",", ","], ["", ")"], ["this", "DT"], ["is", "VBZ"], ["usually", "RB"], ["not", "RB"], ["the", "DT"], ["case.", "CD"], ["Working", "NNP"], [",", ","], ["", ")"], ["even", "RB"], ["at", "IN"], ["a", "DT"], ["reduced", "VBN"], ["schedule", "NN"], [",", ","], ["", ")"], ["helps", "VBZ"], ["you", "PRP"], ["maintain", "VBP"], ["valuable", "JJ"], ["social", "JJ"], ["connections", "NNS"], ["and", "CC"], ["weekly", "JJ"], ["structure", "NN"], [".", "."]], pairs
39
+ #puts pairs.inspect
40
+ # enable these lines for memory leak testing
41
+ $tagger = nil
42
+ ObjectSpace.garbage_collect
43
+ end
44
+
45
+ def test_multiple_docs
46
+ timer = Time.now
47
+ count = 0
48
+ Dir["#{File.dirname(__FILE__)}/docs/doc*"].each do|doc|
49
+ tagger.tag( File.read( doc ) )
50
+ count += 1
51
+ end
52
+ duration = Time.now - timer
53
+ puts "time: #{duration} sec #{count.to_f/duration} docs/sec"
54
+ end
55
+
56
+ private
57
+ def tagger
58
+ $tagger
59
+ end
60
+ end
@@ -0,0 +1,2 @@
1
+ require 'test/unit'
2
+ require File.dirname(__FILE__) + '/../lib/rbtagger'
data/tools/rakehelp.rb ADDED
@@ -0,0 +1,113 @@
1
+ # This final came directly from mongrel 1.0.1 source
2
+ # with a few modifications to support some of my network tests
3
+ # Also, i have figured out yet if this should remain so much a clone of the mongrel tree
4
+ # or become a plugin, need to review more closely how that works
5
+
6
+ def make(makedir)
7
+ Dir.chdir(makedir) do
8
+ sh(PLATFORM =~ /win32/ ? 'nmake' : 'make')
9
+ end
10
+ end
11
+
12
+ def extconf(dir)
13
+ Dir.chdir(dir) do ruby "extconf.rb" end
14
+ end
15
+
16
+ def setup_tests
17
+ Rake::TestTask.new do |t|
18
+ t.test_files = FileList["test/*_test.rb"]
19
+ t.verbose = true
20
+ end
21
+ end
22
+
23
+
24
+ def setup_clean otherfiles
25
+ files = ['build/*', '**/*.o', '**/*.so', '**/*.a', 'lib/*-*', '**/*.log'] + otherfiles
26
+ CLEAN.include(files)
27
+ end
28
+
29
+
30
+ def setup_rdoc files
31
+ Rake::RDocTask.new do |rdoc|
32
+ rdoc.rdoc_dir = 'doc/rdoc'
33
+ rdoc.options << '--line-numbers'
34
+ rdoc.rdoc_files.add(files)
35
+ end
36
+ end
37
+
38
+
39
+ def setup_extension(dir, extension)
40
+ ext = "ext/#{dir}"
41
+ ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
42
+ ext_files = FileList[
43
+ "#{ext}/*.c",
44
+ "#{ext}/*.h",
45
+ "#{ext}/extconf.rb",
46
+ "#{ext}/Makefile",
47
+ "lib"
48
+ ]
49
+
50
+ task "lib" do
51
+ directory "lib"
52
+ end
53
+
54
+ desc "Builds just the #{extension} extension"
55
+ task extension.to_sym => ["#{ext}/Makefile", ext_so ]
56
+
57
+ file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do
58
+ extconf "#{ext}"
59
+ end
60
+
61
+ file ext_so => ext_files do
62
+ make "#{ext}"
63
+ cp ext_so, "lib"
64
+ end
65
+ end
66
+
67
+
68
+ def base_gem_spec(pkg_name, pkg_version)
69
+ rm_rf "test/coverage"
70
+ pkg_version = pkg_version
71
+ pkg_name = pkg_name
72
+ pkg_file_name = "#{pkg_name}-#{pkg_version}"
73
+ Gem::Specification.new do |s|
74
+ s.name = pkg_name
75
+ s.version = pkg_version
76
+ s.platform = Gem::Platform::RUBY
77
+ s.has_rdoc = true
78
+ s.extra_rdoc_files = [ "README" ]
79
+
80
+ s.files = %w(COPYING LICENSE README Rakefile) +
81
+ Dir.glob("{bin,doc/rdoc,test}/**/*") +
82
+ Dir.glob("ext/**/*.{h,c,rb,rl}") +
83
+ Dir.glob("{examples,tools,lib}/**/*.rb")
84
+
85
+ s.require_path = "lib"
86
+ s.extensions = FileList["ext/**/extconf.rb"].to_a
87
+ s.bindir = "bin"
88
+ end
89
+ end
90
+
91
+ def setup_gem(pkg_name, pkg_version)
92
+ spec = base_gem_spec(pkg_name, pkg_version)
93
+ yield spec if block_given?
94
+
95
+ Rake::GemPackageTask.new(spec) do |p|
96
+ p.gem_spec = spec
97
+ p.need_tar = true if RUBY_PLATFORM !~ /mswin/
98
+ end
99
+ end
100
+
101
+ # Conditional require rcov/rcovtask if present
102
+ begin
103
+ require 'rcov/rcovtask'
104
+
105
+ Rcov::RcovTask.new do |t|
106
+ t.test_files = FileList['test/unit/*_test.rb'] + FileList["test/integration/*_test.rb"]
107
+ t.rcov_opts << "-x /usr"
108
+ t.output_dir = "test/coverage"
109
+ t.verbose = true
110
+ end
111
+ rescue Object => e
112
+ puts e.message
113
+ end
@@ -0,0 +1,113 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <title>
8
+ rbtagger
9
+ </title>
10
+ <script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
11
+ <style>
12
+
13
+ </style>
14
+ <script type="text/javascript">
15
+ window.onload = function() {
16
+ settings = {
17
+ tl: { radius: 10 },
18
+ tr: { radius: 10 },
19
+ bl: { radius: 10 },
20
+ br: { radius: 10 },
21
+ antiAlias: true,
22
+ autoPad: true,
23
+ validTags: ["div"]
24
+ }
25
+ var versionBox = new curvyCorners(settings, document.getElementById("version"));
26
+ versionBox.applyCornersToAll();
27
+ }
28
+ </script>
29
+ </head>
30
+ <body>
31
+ <div id="main">
32
+
33
+ <h1>rbtagger</h1>
34
+ <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/ruletagger"; return false'>
35
+ <p>Get Version</p>
36
+ <a href="http://rubyforge.org/projects/ruletagger" class="numbers">0.0.1</a>
37
+ </div>
38
+ <h4 style="float:right;padding-right:10px;"> &#x2192; &#8216;rb-brill-tagger&#8217;</h4>
39
+
40
+ <h2>What</h2>
41
+
42
+
43
+ <p>A Simple Ruby Rule-Based Part of Speech Tagger</p>
44
+
45
+
46
+ <p>This work is based on the work of Eric Brill</p>
47
+
48
+
49
+ <h2>Installing</h2>
50
+
51
+
52
+ <p><pre class='syntax'>sudo gem install rbtagger</pre></p>
53
+
54
+
55
+ <h2>The basics</h2>
56
+
57
+
58
+ <p><pre class='syntax'>
59
+ <span class="ident">tagger</span> <span class="punct">=</span> <span class="constant">Brill</span><span class="punct">::</span><span class="constant">Tagger</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span> <span class="constant">File</span><span class="punct">.</span><span class="ident">join</span><span class="punct">(</span><span class="constant">File</span><span class="punct">.</span><span class="ident">dirname</span><span class="punct">(</span><span class="constant">__FILE__</span><span class="punct">),&quot;</span><span class="string">LEXICON</span><span class="punct">&quot;),</span>
60
+ <span class="constant">File</span><span class="punct">.</span><span class="ident">join</span><span class="punct">(</span><span class="constant">File</span><span class="punct">.</span><span class="ident">dirname</span><span class="punct">(</span><span class="constant">__FILE__</span><span class="punct">),&quot;</span><span class="string">LEXICALRULEFILE</span><span class="punct">&quot;),</span>
61
+ <span class="constant">File</span><span class="punct">.</span><span class="ident">join</span><span class="punct">(</span><span class="constant">File</span><span class="punct">.</span><span class="ident">dirname</span><span class="punct">(</span><span class="constant">__FILE__</span><span class="punct">),&quot;</span><span class="string">CONTEXTUALRULEFILE</span><span class="punct">&quot;)</span> <span class="punct">)</span>
62
+ <span class="ident">docs</span><span class="punct">.</span><span class="ident">each</span> <span class="keyword">do</span><span class="punct">|</span><span class="ident">doc</span><span class="punct">|</span>
63
+ <span class="ident">tagger</span><span class="punct">.</span><span class="ident">tag</span><span class="punct">(</span> <span class="constant">File</span><span class="punct">.</span><span class="ident">read</span><span class="punct">(</span> <span class="ident">doc</span> <span class="punct">)</span> <span class="punct">)</span>
64
+ <span class="keyword">end</span>
65
+ </pre></p>
66
+
67
+
68
+ <h2>Forum</h2>
69
+
70
+
71
+ <p><a href="http://groups.google.com/group/rb-brill-tagger">http://groups.google.com/group/rb-brill-tagger</a></p>
72
+
73
+
74
+ <h2>How to submit patches</h2>
75
+
76
+
77
+ <p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people&#8217;s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
78
+
79
+
80
+ <ul>
81
+ <li>github: <a href="http://github.com/taf2/rb-brill-tagger/tree/master">http://github.com/taf2/rb-brill-tagger/tree/master</a></li>
82
+ </ul>
83
+
84
+
85
+ <pre>git clone git://github.com/taf2/rb-brill-tagger.git</pre>
86
+
87
+ <h3>Build and test instructions</h3>
88
+
89
+
90
+ <pre>cd rb-brill-tagger
91
+ rake test
92
+ rake install_gem</pre>
93
+
94
+ <h2>License</h2>
95
+
96
+
97
+ <p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
98
+
99
+
100
+ <h2>Contact</h2>
101
+
102
+
103
+ <p>Comments are welcome. Send an email to <a href="mailto:FIXME"><span class="caps">FIXME</span> full name</a> email via the <a href="http://groups.google.com/group/rb-brill-tagger">forum</a></p>
104
+ <p class="coda">
105
+ <a href="FIXME email">FIXME full name</a>, 14th May 2008<br>
106
+ Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
107
+ </p>
108
+ </div>
109
+
110
+ <!-- insert site tracking codes here, like Google Urchin -->
111
+
112
+ </body>
113
+ </html>
data/website/index.txt ADDED
@@ -0,0 +1,53 @@
1
+ h1. rbtagger
2
+
3
+ <h4 style="float:right;padding-right:10px;"> &#x2192; 'rb-brill-tagger'</h4>
4
+
5
+
6
+ h2. What
7
+
8
+ A Simple Ruby Rule-Based Part of Speech Tagger
9
+
10
+ This work is based on the work of Eric Brill
11
+
12
+ h2. Installing
13
+
14
+ <pre syntax="bash">sudo gem install rbtagger</pre>
15
+
16
+ h2. The basics
17
+
18
+ <pre syntax="ruby">
19
+ tagger = Brill::Tagger.new( File.join(File.dirname(__FILE__),"LEXICON"),
20
+ File.join(File.dirname(__FILE__),"LEXICALRULEFILE"),
21
+ File.join(File.dirname(__FILE__),"CONTEXTUALRULEFILE") )
22
+ docs.each do|doc|
23
+ tagger.tag( File.read( doc ) )
24
+ end
25
+ </pre>
26
+
27
+ h2. Forum
28
+
29
+ "http://groups.google.com/group/rb-brill-tagger":http://groups.google.com/group/rb-brill-tagger
30
+
31
+ h2. How to submit patches
32
+
33
+ Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
34
+
35
+ * github: "http://github.com/taf2/rb-brill-tagger/tree/master":http://github.com/taf2/rb-brill-tagger/tree/master
36
+
37
+ <pre>git clone git://github.com/taf2/rb-brill-tagger.git</pre>
38
+
39
+ h3. Build and test instructions
40
+
41
+ <pre>cd rb-brill-tagger
42
+ rake test
43
+ rake install_gem</pre>
44
+
45
+
46
+ h2. License
47
+
48
+ This code is free to use under the terms of the MIT license.
49
+
50
+ h2. Contact
51
+
52
+ Comments are welcome. Send an email to "FIXME full name":mailto:FIXME email via the "forum":http://groups.google.com/group/rb-brill-tagger
53
+