In [86]:
import numpy as np
import pandas as pd
import re
import os, sys
import nltk

class CorefOutputParser:
    
    def __init__(self, file):
        self.entity_dict = {}
        self.df = pd.read_csv(file, sep='\t', header=None)
        self.df.columns = ["document_name","some id", "sentence_word_nr", "word", "pos_tag", "parsing_part", "", "", "", "", "", "coref"]
    
    def __get_entity(self, coref_num, start_index):
        
        entity = ""
        search_length = 5
        good_tags = ["DT", "NNP", "NNS", "NN", "NNPS", "PRP", "PRP$", "JJ", "JJR", "JJS", "CC", "CD", "POS", "IN"]
        important_tags = ["NNP", "NNS", "NN", "NNPS"]
        found_end = False
        end_index = None
        contains_important_tag = False
        
        for index in range(start_index, start_index + search_length):
                
            if index >= self.df.shape[0]:
                break
                
            if not isinstance(self.df.ix[index, "coref"], str):
                continue #jump to next index
            
            entity += self.df.ix[index, "word"] + " "
            
            #queck for bad pos_tags in entity
            if self.df.ix[index, "pos_tag"] not in good_tags:
                return (None, None)
            
            if self.df.ix[index, "pos_tag"] in important_tags:
                contains_important_tag = True
                
            #find end of entity
            coref = self.df.ix[index, "coref"]
            digits_in_coref = re.findall("\d+", coref)
            if ")" in coref and str(coref_num) in digits_in_coref:
                found_end = True
                end_index = index
                break
                
        if found_end and contains_important_tag:
            return (entity.strip(), end_index)
        else:
            return (None, None)
            
    def __create_entity_dict(self):
        '''
        private
        '''
        current_coref_num = None
        
        for index, row in self.df.iterrows():
            if (isinstance(row["coref"], str)):
                match = re.search("\d+", row["coref"])
                if match != None:
                    current_coref_num = int(match.group())
                
                if "(" in row["coref"] and ")" in row["coref"]:
                    tmp_entity = row["word"]
                    if current_coref_num not in self.entity_dict:
                        self.entity_dict[current_coref_num] = tmp_entity
                elif "(" in row["coref"]:
                    tmp_entity, end_index = self.__get_entity(current_coref_num, index)
                    if tmp_entity != None and current_coref_num not in self.entity_dict:
                        self.entity_dict[current_coref_num] = tmp_entity
    
    def get_resolved_text(self):
        self.__create_entity_dict()
        
        self.count = 0
        self.count_removed_sents = 0
        total_text = ""
        sent_text = ""
        coref_num = None
        sent_contains_entity = False
        
        length = self.df.shape[0]
        index = 0

        while index < length:
            row = self.df.loc[index]
            found_entity = False
            if (isinstance(row["coref"], str)):
                
                if row["sentence_word_nr"] == 0:
                    if sent_contains_entity:
                        total_text += sent_text
                    else:
                        self.count_removed_sents += 1
                        
                    sent_text = ""
                    sent_contains_entity = False
                        
                    
                match = re.search("\d+", row["coref"])
                if match != None:
                    coref_num = int(match.group())
                    sent_contains_entity = True
                    
                if "(" in row["coref"] and ")" in row["coref"] and coref_num in self.entity_dict:
                    sent_text += self.entity_dict[coref_num] + " "
                    self.count += 1
                    found_entity = True
                elif "(" in row["coref"] and coref_num in self.entity_dict:
                    tmp_entity, end_index = self.__get_entity(coref_num, index)
                    if tmp_entity:
                        sent_text += self.entity_dict[coref_num] + " "
                        index = end_index
                        self.count += 1
                        found_entity = True
                        
                if not found_entity:
                    sent_text += row["word"] + " "
                    
                    
            index += 1
            
        total_text = "\n".join(nltk.sent_tokenize(total_text))
        total_text = total_text.replace("-RRB-", ")")
        total_text = total_text.replace("-LRB-", "(")
        
        return total_text
    
    def get_orig_text(self):
        text = ""
        for index, row in self.df.iterrows():    
            text += row["word"] + " "
            
        return text
    
    def print_df(self):
        print(self.df[["word", "coref"]].to_string())
        

print("--generating textfile with resolutions...")
corefOutputParser = CorefOutputParser("output_coref/jupiter-coref-raw.txt")

#df = corefOutputParser.print_df()

new_text = corefOutputParser.get_resolved_text()
print("-- number of resolved referenes: ", corefOutputParser.count)
print("-- number of removed sents (lacking entity): ", corefOutputParser.count_removed_sents)

#corefOutputParser.create_entity_dict()
#corefOutputParser.entity_dict


--generating textfile with resolutions...
-- number of resolved referenes:  712
-- number of removed sents (lacking entity):  30

In [ ]:
#corefOutputParser.get_entity(4, 59)
#corefOutputParser.entity_dict

In [87]:
new_text


Out[87]:
"Jupiter is the fifth planet from the Sun and the largest planet in the Solar System .\nJupiter is a giant planet with a mass one-thousandth of that of the Sun , but is two and a half times that of all the other planets in the Solar System combined .\nJupiter is a gas giant , along with Saturn ( Uranus and Neptune are ice giants ) .\nJupiter was known to astronomers of ancient times .\nThe Romans named The Romans after Jupiter god Jupiter .\nWhen viewed from Earth , Jupiter can reach an apparent magnitude of 2.94 , bright enough to cast shadows , and making Jupiter on average the third-brightest object in the night sky after the Moon and Venus .\nJupiter is primarily composed of hydrogen with a quarter of its mass being helium , although helium only comprises about a tenth of the number of molecules .\nhelium may also have a rocky core of heavier elements , but like the other giant planets , Jupiter lacks a well-defined solid surface .\nBecause of Jupiter rapid rotation , the planet 's shape is that of an oblate spheroid ( it has a slight but noticeable bulge around the equator ) .\nThe outer atmosphere is visibly segregated into several bands at different latitudes , resulting in turbulence and storms along several bands at different latitudes interacting boundaries .\nA prominent result is the Great Red Spot , a giant storm that is known to have existed since at least the 17th century when it was first seen by telescope .\nJupiter is a faint planetary ring system and a powerful magnetosphere .\nJupiter has at least 67 moons , including the four large Galilean moons discovered by Galileo Galilei in 1610 .\nGanymede , the largest of these , has a diameter greater than that of the planet Mercury .\nJupiter has been explored on several occasions by robotic spacecraft , most notably during the early Pioneer and Voyager flyby missions and later by the Galileo orbiter .\nThe most recent probe to visit Jupiter was the Pluto-bound New Horizons spacecraft in late February 2007 .\nThe probe used the gravity from Jupiter to increase The probe speed .\nFuture targets for exploration in the Jovian system include the possible ice-covered liquid ocean on the moon Europa .\nA set of new super-Earths may have originally populated the inner Solar System .\nEarth and A set of new super-Earths neighbor planets may have formed from fragments of planets after collisions with Jupiter destroyed new super-Earths near the Sun .\nAs Jupiter came toward the inner Solar System , in what theorists call the Grand Tack Hypothesis , gravitational tugs and pulls occurred causing a series of collisions between new super-Earths as their orbits began to overlap .\nAstronomers have discovered nearly 500 planetary systems each with multiple planets , and typically these systems include a few planets with masses several times greater than Earth ( super-Earths ) , orbiting closer to their star than the planet Mercury is to the Sun , and Jupiter-like gas giants are also often found close to their star .\nIt appears that Jupiter is in its present orbit in the Solar System because Saturn pulled Jupiter out during Saturn migration .\nJupiter moving out of the inner Solar System would have allowed the formation of inner planets , including A set of new super-Earths .\nJupiter is composed primarily of gaseous and liquid matter .\nJupiter is the largest of the four giant planets in the Solar System and hence Jupiter largest planet .\nJupiter has a diameter of 142,984 km ( 88,846 mi ) at its equator .\nThe density of Jupiter , 1.326 g\\/cm3 , is the second highest of the giant planets , but lower than those of the four terrestrial planets .\nJupiter upper atmosphere is composed of about 88 92 % hydrogen and 8 12 % helium by percent volume of gas molecules .\nBecause a helium atom has about four times as much mass as a hydrogen atom , the composition changes when described as the proportion of mass contributed by different atoms .\nThus , Jupiter atmosphere is approximately 75 % hydrogen and 24 % helium by mass , with the remaining one percent of mass consisting of other elements .\nThe interior contains denser materials , such that the distribution is roughly 71 % hydrogen , 24 % helium and 5 % other elements by mass .\nThe atmosphere contains trace amounts of methane , water vapor , ammonia , and silicon-based compounds .\nThe outermost layer of The atmosphere contains crystals of frozen ammonia .\nNeon in The atmosphere only consists of 20 parts per million by mass , which is about a tenth as abundant as in the Sun .\nHelium is also depleted , to about 80 % of the Sun helium composition .\nThis depletion is a result of precipitation of these elements into the interior of the planet .\nAbundances of heavier inert gases in Jupiter atmosphere are about two to three times that of the Sun .\nBased on spectroscopy , Saturn is thought to be similar in composition to Jupiter , but the other giant planets Uranus and Neptune have relatively much less hydrogen and helium .\nBecause of the lack of atmospheric entry probes , high-quality abundance numbers of these elements are lacking for the outer planets beyond Jupiter .\nJupiter mass is 2.5 times that of all the other planets in the Solar System combined this is so massive that its barycenter with the Sun lies above the Sun surface at 1.068 solar radii from the Sun center .\nAlthough with a diameter 11 times that of A set of new super-Earths , it is much larger , it is considerably less dense .\nJupiter volume is that of about 1,321 Earths , but it is only 318 times as massive .\nJupiter radius is about 1\\/10 the radius of the Sun , and its mass is 0.001 times the mass of the Sun , so the density of the two bodies is similar .\nA '' its '' ( MJ or MJup ) is often used as a unit to describe masses of other objects , particularly extrasolar planets and brown dwarfs .\nSo , for example , the extrasolar planet HD 209458 b has a mass of 0.69 MJ , while Kappa Andromedae b has a mass of MJ .\nTheoretical models indicate that if Jupiter had much more mass than Jupiter does at present , Jupiter would shrink .\nFor small changes in mass , the radius would not change appreciably , and above about 500 M ( 1.6 Jupiter masses ) The interior would become so much more compressed under the increased pressure that The interior volume would decrease despite the increasing amount of matter .\nAs a result , Jupiter is thought to have about as large a diameter as a planet of Jupiter composition and evolutionary history can achieve .\nThe process of further shrinkage with increasing mass would continue until appreciable stellar ignition is achieved as in high-mass brown dwarfs having around 50 Jupiter masses .\nAlthough Jupiter would need to be about 75 times as massive to fuse hydrogen and become a star , the smallest red dwarf is only about 30 percent larger in radius than Jupiter .\nDespite this , Jupiter still radiates more heat than Jupiter receives from the Sun ; the amount of heat produced inside Jupiter is similar to the total solar radiation Jupiter receives .\nThis additional heat is generated by the Kelvin Helmholtz mechanism through contraction .\nThis process causes Jupiter to shrink by about 2 cm each year .\nWhen it was first formed , Jupiter was much hotter and was about twice Jupiter current diameter .\nJupiter is thought to consist of a dense core with a mixture of elements , a surrounding layer of liquid metallic hydrogen with some helium , and an outer layer predominantly of molecular hydrogen .\nThe core is often described as rocky , but The core detailed composition is unknown , as are the properties of materials at the temperatures and pressures of those depths ( see below ) .\nIn 1997 , the existence of The core was suggested by gravitational measurements , indicating a mass of from 12 to 45 times A set of new super-Earths mass or roughly 4 % 14 % of the total mass of Jupiter .\nThe presence of a core during at least part of Jupiter history is suggested by models of planetary formation that require the formation of a rocky or icy core massive enough to collect its bulk of hydrogen and helium from the protosolar nebula .\nAssuming its did exist , its may have shrunk as convection currents of hot liquid metallic hydrogen mixed with the molten core and carried its contents to higher levels in the planetary interior .\nThe uncertainty of the models is tied to the error margin in hitherto measured parameters : one of the rotational coefficients ( J6 ) used to describe the planet 's gravitational moment , Jupiter equatorial radius , and its temperature at 1 bar pressure .\nThe Juno mission , which launched in August 2011 , is expected to better constrain the values of these parameters , and thereby make progress on the problem of The core .\nThe core region is surrounded by dense metallic hydrogen , which extends outward to about 78 % of the radius of the planet 's .\nRain-like droplets of helium and neon precipitate downward through this layer , depleting the abundance of these elements in The atmosphere .\nAbove this layer lies a transparent interior atmosphere of hydrogen .\nAt this depth , its is above its , which for hydrogen is only 33 K. In this state , there are no distinct liquid and gas phases hydrogen is said to be in a supercritical fluid state .\nits is convenient to treat hydrogen as gas in the upper layer extending downward from this layer to a depth of about 1,000 km , and as liquid in deeper layers .\nPhysically , there is no clear boundary the gas smoothly becomes hotter and denser as one descends .\nThe temperature and pressure inside Jupiter increase steadily toward The core , due to the Kelvin Helmholtz mechanism .\nAt the '' surface '' pressure level of 10 bars , its is around 340 K ( 67 C ; 152 F ) .\nAt the phase transition region where hydrogen heated beyond its critical point becomes metallic , its is believed its is 10,000 K ( 9,700 C ; 17,500 F ) and the pressure is 200 GPa .\nThe temperature at the core boundary is estimated to be 36,000 K ( C ; 17,500 F ) and the pressure is roughly 3,000 4,500 GPa .\nJupiter has the largest planetary atmosphere in the Solar System , spanning over 5,000 km ( 3,107 mi ) in altitude .\nAs Jupiter has no surface , the base of its atmosphere is usually considered to be the point at which atmospheric pressure is equal to 1 MPa ( 10 bar ) , or ten times surface pressure on A set of new super-Earths .\nJupiter is perpetually covered with clouds composed of ammonia crystals and possibly ammonium hydrosulfide .\nThe clouds are located in the tropopause and are arranged into bands of different latitudes , known as tropical regions .\nThe zones have been observed to vary in width , color and intensity from year to year , but The zones have remained sufficiently stable for astronomers to give The zones identifying designations .\nThe cloud layer is only about 50 km ( 31 mi ) deep , and consists of at least two decks of clouds : a thick lower deck and a thin clearer region .\nThere may also be a thin layer of water clouds underlying The cloud layer , as evidenced by flashes of lightning detected in the atmosphere of Jupiter .\nThese electrical discharges can be up to a thousand times as powerful as lightning on A set of new super-Earths .\nThe clouds can form thunderstorms driven by the heat rising from The interior .\nThe orange and brown coloration in The clouds are caused by upwelling compounds that change color when they are exposed to ultraviolet light from the Sun .\nThese colorful compounds , known as chromophores , mix with the warmer , lower deck of clouds .\nThe zones are formed when rising convection cells form crystallizing ammonia that masks out these lower clouds from view .\nJupiter low axial tilt means that the poles constantly receive less solar radiation than at the planet 's equatorial region .\nConvection within the interior of the planet transports more energy to the poles , balancing out the temperatures at The cloud layer .\nThe best known feature of Jupiter is the Great Red Spot , a persistent anticyclonic storm that is larger than A set of new super-Earths , located 22 south of the equator .\nIt is known to have been in existence since at least 1831 , and possibly since 1665 .\nImages by the Hubble Space Telescope have shown as many as two '' red spots '' adjacent to the Great Red Spot .\nThe storm is large enough to be visible through Earth-based telescopes with an aperture of 12 cm or larger .\nMathematical models suggest that The storm is stable and may be a permanent feature of the planet 's .\nthe Great Red Spot dimensions are 24 40,000 km 12 14,000 km .\nIt is large enough to contain two or three planets of A set of new super-Earths diameter .\nThe maximum altitude of The storm is about 8 km ( 5 mi ) above the surrounding cloudtops .\nJupiter also has white ovals and brown ovals , which are lesser unnamed storms .\nwhite ovals tend to consist of relatively cool clouds within The atmosphere .\nwhite ovals are warmer and located within the '' normal cloud layer '' .\nEven before Voyager proved that It was a storm , there was strong evidence that the spot could not be associated with any deeper feature on the planet 's surface , as the Great Red Spot rotates differentially with respect to the rest of The atmosphere , sometimes faster and sometimes more slowly .\nDuring the Great Red Spot recorded history the Great Red Spot has traveled several times around the planet relative to any possible fixed rotational marker below the Great Red Spot .\nIn 2000 , an atmospheric feature formed in the southern hemisphere that is similar in appearance to the Great Red Spot , but smaller .\nan atmospheric feature was named Oval BA , and has been nicknamed Red Spot Junior .\nan atmospheric feature has since increased in intensity and changed color from white to red .\nJupiter has a faint planetary ring system composed of three main segments : an inner torus of particles known as the halo , a relatively bright main ring , and an outer gossamer ring .\nThese rings appear to be made of dust , rather than ice as with Saturn rings .\nan outer gossamer ring is probably made of material ejected from the satellites Adrastea and Metis .\nMaterial that would normally fall back to the moon is pulled into Jupiter because of Jupiter strong gravitational influence .\nThe orbit of the material veers towards Jupiter and new material is added by additional impacts .\nIn a similar way , the moons Thebe and Amalthea probably produce the two distinct components of an outer gossamer ring .\nThere is also evidence of a rocky ring strung along Amalthea orbit which may consist of collisional debris from the moon .\nJupiter magnetic field is 14 times as strong as A set of new super-Earths , ranging from 4.2 gauss ( 0.42 mT ) at the equator to 10 14 gauss ( 1.0 1.4 mT ) at the poles , making it the strongest in the Solar System ( except for sunspots ) .\nThis field is believed to be generated by eddy currents swirling movements of conducting materials within The core .\nThe volcanoes on the moon Io emit large amounts of sulfur dioxide forming a gas torus along the moon orbit .\nthe gas is ionized in the magnetosphere producing sulfur and oxygen ions .\nthe gas , together with hydrogen ions originating from the atmosphere of Jupiter , form a plasma sheet in Jupiter equatorial plane .\nThe plasma in the sheet co-rotates with the planet causing deformation of the dipole magnetic field into that of magnetodisk .\nElectrons within the sheet generate a strong radio signature that produces bursts in the range of 0.6 30 MHz .\nAt about 75 Jupiter radii from the planet 's , the interaction of the magnetosphere with the solar wind generates a bow shock .\nJupiter magnetosphere is a magnetopause , located at the inner edge of a magnetosheath a region between it and a bow shock .\nthe solar wind interacts with these regions , elongating it on Jupiter lee side and extending it outward until the solar wind nearly reaches the orbit of Saturn .\nThe four largest moons of Jupiter all orbit within it , which protects them from the solar wind .\nit is responsible for intense episodes of radio emission from the planet 's polar regions .\nVolcanic activity on the Jovian moon Io ( see below ) injects gas into Jupiter magnetosphere , producing a torus of particles about the planet 's .\nAs the moon Io moves through this torus , the interaction generates Alfv n waves that carry ionized matter into the polar regions of Jupiter .\nWhen A set of new super-Earths intersects this cone , the radio emissions from Jupiter can exceed the solar radio output .\nJupiter is the only planet that has a barycenter with the Sun that lies outside the volume of the Sun , though by only 7 % of the Sun radius .\nThe average distance between Jupiter and the Sun is 778 million km ( about 5.2 times the average distance from A set of new super-Earths to the Sun , or 5.2 AU ) and it completes an orbit every 11.86 years .\nThis is two-fifths the orbital period of Saturn , forming a 5:2 orbital resonance between the two largest planets in the Solar System .\nits is inclined 1.31 compared to A set of new super-Earths .\nBecause of an eccentricity of 0.048 , the distance from Jupiter and the Sun varies by 75 million km between perihelion and aphelion , or the nearest and most distant points of the planet along the orbital path respectively .\nThe axial tilt of Jupiter is relatively small : only 3.13 .\nAs a result , The axial tilt of Jupiter does not experience significant seasonal changes , in contrast to , for example , A set of new super-Earths and Mars .\nJupiter rotation is the fastest of all the Solar System 's planets , completing a rotation on its axis in slightly less than ten hours ; this creates an equatorial bulge easily seen through an Earth-based amateur telescope .\nthe planet 's is shaped as an oblate spheroid , meaning that the diameter across its equator is longer than the diameter measured between its poles .\nOn Jupiter , the diameter across its equator is 9,275 km ( 5,763 mi ) longer than the diameter measured through its .\nBecause Jupiter is not a solid body , its upper atmosphere undergoes differential rotation .\nThe rotation of Jupiter polar atmosphere is about 5 minutes longer than that of its ; three systems are used as frames of reference , particularly when graphing the motion of atmospheric features .\nthe inner Solar System I applies from the latitudes 10 N to 10 S ; its period is the planet 's shortest , at 9h 50m 30.0 s .\nSystem II applies at all latitudes north and south of these ; its period is 9h 55m 40.6 s .\nSystem II was first defined by radio astronomers , and corresponds to the rotation of the planet 's magnetosphere ; its period is Jupiter official rotation .\nJupiter is usually the fourth brightest object in the sky ( after the Sun , the Moon and Venus and Venus ) ; at times Mars appears brighter than Jupiter .\nDepending on Jupiter position with respect to A set of new super-Earths , Jupiter can vary in visual magnitude from as bright as 2.9 at opposition down to 1.6 during conjunction with the Sun .\nthe diameter across its equator likewise varies from 50.1 to 29.8 arc seconds .\nFavorable oppositions occur when Jupiter is passing through perihelion , an event that occurs once per orbit .\nAs Jupiter approached perihelion in March 2011 , there was a favorable opposition in September 2010 .\nA set of new super-Earths overtakes Jupiter every 398.9 days as A set of new super-Earths orbits the Sun , a duration called the synodic period .\nAs A set of new super-Earths does so , Jupiter appears to undergo retrograde motion with respect to the background stars .\nThat is , for a period Jupiter seems to move backward in the night sky , performing a looping motion .\nJupiter 12-year orbital period corresponds to the dozen astrological signs of the zodiac , and may have been the historical origin of the signs .\nThat is , Jupiter reaches opposition Jupiter has advanced eastward by about 30 , the width of a zodiac sign .\nBecause its is outside A set of new super-Earths , the phase angle of Jupiter as viewed from A set of new super-Earths never exceeds 11.5 .\nThat is , the planet 's always appears nearly fully illuminated when viewed through Earth-based telescopes .\nthe planet 's was only during spacecraft missions to Jupiter that crescent views of the planet 's were obtained .\nA small telescope will usually show Jupiter four Galilean moons and the prominent cloud belts across Jupiter atmosphere .\nA small telescope will show Jupiter Great Red Spot when A small telescope faces A set of new super-Earths .\nThe observation of Jupiter dates back to the Babylonian astronomers of the 7th or 8th century BC .\nThe Chinese historian of astronomy , Xi Zezong , has claimed that Gan De , a Chinese astronomer , made the discovery of one of Jupiter moons in 362 BC with the unaided eye .\nIf accurate , this would predate Galileo discovery by nearly two millennia .\nIn his 2nd century work the Almagest , the Hellenistic astronomer Claudius Ptolemaeus constructed a geocentric planetary model based on deferents and epicycles to explain Jupiter motion relative to A set of new super-Earths , giving Jupiter orbital period around A set of new super-Earths as 4332.38 days , or 11.86 years .\nIn 499 , Aryabhata , a mathematician astronomer from the classical age of Indian mathematics and astronomy , also used a geocentric model to estimate Jupiter period as 4332.2722 days , or 11.86 years .\nIn 1610 , Galileo Galilei discovered the four largest moons of Jupiter Io , Europa , Ganymede and Callisto ( now known as the Galilean moons ) using a telescope ; thought to be the first telescopic observation of moons other than A set of new super-Earths .\nGalileo was also the first discovery of a celestial motion not apparently centered on A set of new super-Earths .\nGalileo was a major point in favor of Copernicus ' heliocentric theory of the motions of the planets ; Galileo outspoken support of the Copernican theory placed Copernicus ' under the threat of the Inquisition .\nDuring the 1660s , Cassini used a new telescope to discover spots and colorful bands on Jupiter and observed that the planet 's appeared oblate ; that is , flattened at its .\nCopernicus ' was also able to estimate the rotation period of the planet 's .\nIn 1690 Cassini noticed that The atmosphere undergoes differential rotation .\nThe Great Red Spot , a prominent oval-shaped feature in the southern hemisphere of Jupiter , may have been observed as early as 1664 by Robert Hooke and in 1665 by Giovanni Cassini , although this is disputed .\nThe pharmacist Heinrich Schwabe produced the earliest known drawing to show details of the Great Red Spot in 1831 .\nThe Red Spot was reportedly lost from sight on several occasions between 1665 and 1708 before becoming quite conspicuous in 1878 .\nThe Red Spot was recorded as fading again in 1883 and at the start of the 20th century .\nBoth Giovanni Borelli and Cassini made careful tables of the motions of the Jovian moons , allowing predictions of the times when the Jovian moons would pass before or behind the planet 's .\nBy the 1670s , it was observed that when Jupiter was on the opposite side of the Sun from A set of new super-Earths , these events would occur about 17 minutes later than expected .\nOle R mer deduced that sight is not instantaneous ( a conclusion that Cassini had earlier rejected ) , and this timing discrepancy was used to estimate the speed of light .\nIn 1892 , E. E. Barnard observed a fifth satellite of Jupiter with the 36-inch ( 910 mm ) refractor at Lick Observatory in California .\nThe discovery of this relatively small object , a testament to E. E. Barnard keen eyesight , quickly made E. E. Barnard famous .\nthe moon was later named Amalthea .\nthe moon was the last planetary moon to be discovered directly by visual observation .\nIn 1932 , Rupert Wildt identified absorption bands of ammonia and methane in the spectra of Jupiter .\nThree long-lived anticyclonic features termed white ovals were observed in 1938 .\nFor several decades Three long-lived anticyclonic features remained as separate features in The atmosphere , sometimes approaching each other but never merging .\nFinally , two of white ovals merged in 1998 , then absorbed the third in 2000 , becoming Oval BA .\nIn 1955 , Bernard Burke and Kenneth Franklin detected bursts of radio signals coming from Jupiter at 22.2 MHz .\nThe period of bursts of radio signals matched the rotation of the planet 's , and Bernard Burke and Kenneth Franklin were also able to use this information to refine the rotation rate .\nRadio bursts from Jupiter were found to come in two forms : long bursts ( or L-bursts ) lasting up to several seconds , and short bursts ( or S-bursts ) that had a duration of less than a hundredth of a second .\nScientists discovered that there were three forms of radio signals transmitted from Jupiter .\nDecametric radio bursts ( with a wavelength of tens of meters ) vary with the rotation of Jupiter , and are influenced by interaction of the moon Io with Jupiter magnetic field .\nThe origin of this signal was from a torus-shaped belt around Jupiter equator .\nthis signal is caused by cyclotron radiation from electrons that are accelerated in Jupiter magnetic field .\nThermal radiation is produced by heat in the atmosphere of Jupiter .\nSince 1973 a number of automated spacecraft have visited Jupiter , most notably the Pioneer 10 space probe , the first spacecraft to get close enough to Jupiter to send back revelations about the properties and phenomena of the Solar System largest planet .\nFlights to other planets within the Solar System are accomplished at a cost in energy , which is described by the net change in velocity of automated spacecraft , or delta - v. Entering a Hohmann transfer orbit from A set of new super-Earths to Jupiter from low Earth orbit requires a delta-v of 6.3 km\\/s which is comparable to the 9.7 km\\/s delta-v needed to reach low Earth orbit .\nFortunately , gravity assists through planetary flybys can be used to reduce the energy required to reach Jupiter , albeit at the cost of a significantly longer flight duration .\nBeginning in 1973 , several spacecraft have performed planetary flyby maneuvers that brought several spacecraft within observation range of Jupiter .\nThe Pioneer missions obtained the first close-up images of Jupiter atmosphere and several of its moons .\nThe Pioneer missions discovered that the radiation fields near the planet 's were much stronger than expected , but several spacecraft managed to survive in that environment .\nThe trajectories of several spacecraft were used to refine the mass estimates of the Jovian system .\nRadio occultations by the planet 's resulted in better measurements of Jupiter diameter and the amount of polar flattening .\nSix years later , The Pioneer missions vastly improved the understanding of the Galilean moons and discovered Jupiter rings .\nThey also confirmed that the Great Red Spot was anticyclonic .\nComparison of images showed that The Red Spot had changed hue since The Pioneer missions , turning from orange to dark brown .\nA torus of ionized atoms was discovered along the moon Io orbital path , and volcanoes were found on the moon surface , some in the process of erupting .\nAs automated spacecraft passed behind the planet 's , automated spacecraft observed flashes of lightning in the night side atmosphere .\nThe next mission to encounter Jupiter , the Ulysses solar probe , performed a flyby maneuver to attain a polar orbit around the Sun .\nDuring this pass automated spacecraft conducted studies on Jupiter magnetosphere .\nSince Ulysses has no cameras , no images were taken .\nIn 2000 , The probe , en route to Saturn , flew by Jupiter and provided some of the highest-resolution images ever made of the planet 's .\nOn December 19 , 2000 , automated spacecraft captured an image of the moon Himalia , but the resolution was too low to show surface details .\nThe probe , en route to Pluto , flew by Jupiter for gravity assist .\nThe probe closest approach was on February 28 , 2007 .\nThe probe cameras measured plasma output from volcanoes on the moon Io and studied all four Galilean moons in detail , as well as making long-distance observations of all four Galilean moons Himalia and Elara .\nImaging of the Jovian system began September 4 , 2006 .\nSo far the only spacecraft to Jupiter is the Galileo orbiter , which went into orbit around Jupiter on December 7 , 1995 .\nIt orbited the planet 's for over seven years , conducting multiple flybys of all the Galilean moons and Amalthea .\nautomated spacecraft also witnessed the impact of Comet Shoemaker Levy 9 as automated spacecraft approached Jupiter in 1994 , giving a unique vantage point for the event .\nWhile the information gained about the Jovian system from Galileo was extensive , its originally designed capacity was limited by the failed deployment of its high-gain radio transmitting antenna .\nA 340-kilogram titanium atmospheric probe was released from automated spacecraft in July 1995 , entering Jupiter atmosphere on December 7 .\nA 340-kilogram titanium atmospheric probe parachuted through 150 km ( 93 mi ) of The atmosphere at speed of about 2,575 km\\/h ( 1600 mph ) and collected data for 57.6 minutes before it was crushed by the pressure ( about 23 times Earth normal , at a temperature of California ) .\nThe Galileo orbiter itself experienced a more rapid version of the same fate when The Galileo orbiter itself was deliberately steered into the planet on September 21 , 2003 , at a speed of over 50 km\\/s , to avoid any possibility of The Galileo orbiter itself crashing into and possibly contaminating the moon Europa a moon which has been hypothesized to have the possibility of harboring life .\nData from this mission revealed that hydrogen composes up to 90 % of Jupiter atmosphere .\nNASA has a mission underway to study Jupiter in detail from a polar orbit .\nNamed Juno , automated spacecraft launched in August 2011 , and will arrive in late 2016 .\nThe next planned mission to the Jovian system will be the European Space Agency 's Jupiter Icy Moon Explorer ( JUICE ) , due to launch in 2022 , followed by NASA Europa Clipper mission in 2025 .\nBecause of the possibility of subsurface liquid oceans on Jupiter moons Europa , Ganymede and Callisto , there has been great interest in studying the icy moons in detail .\nNASA JIMO ( Jupiter Icy Moons Orbiter ) was cancelled in 2005 .\nA subsequent proposal for a joint NASA\\/ESA mission , called EJSM\\/Laplace , was developed with a provisional launch date around 2020 .\nEJSM\\/Laplace would have consisted of the NASA-led Jupiter Europa Orbiter , and the ESA-led Jupiter Ganymede Orbiter .\nHowever by April 2011 , the ESA-led Jupiter Ganymede Orbiter had formally ended the partnership citing budget issues at NASA and the consequences on the mission timetable .\nInstead the ESA-led Jupiter Ganymede Orbiter planned to go ahead with a European-only mission to compete in the ESA-led Jupiter Ganymede Orbiter L1 Cosmic Vision selection .\nJupiter has 67 natural satellites .\nThe four largest moons , visible from Earth with binoculars on a clear night , known as the '' Galilean moons '' , are the moon Io , Europa , Ganymede , and Callisto .\nThe orbits of the moon Io , Europa , and Ganymede , some of the largest satellites in the Solar System , form a pattern known as a Laplace resonance ; for every four orbits that the moon Io makes around Jupiter , the moon Europa makes exactly two orbits and Ganymede makes exactly one .\na Laplace resonance causes the gravitational effects of the three large moons to distort their orbits into elliptical shapes , since the moon receives an extra tug from a Laplace resonance neighbors at the same point in every orbit a Laplace resonance makes .\nThe tidal force from Jupiter , on the other hand , works to circularize their orbits .\nThe eccentricity of their orbits causes regular flexing of the three large moons shapes , with Jupiter gravity stretching them out as them approach Jupiter and allowing them to spring back to more spherical shapes as them swing away .\nThis tidal flexing heats the three large moons interiors by friction .\nThis is seen most dramatically in the extraordinary volcanic activity of innermost Io ( which is subject to the strongest tidal forces ) , and to a lesser degree in the geological youth of the moon Europa surface ( indicating recent resurfacing of the moon exterior ) .\nBefore the discoveries of The Pioneer missions , Jupiter moons were arranged neatly into four groups of four , based on commonality of their orbital elements .\nSince then , the large number of new small outer moons has complicated this picture .\nA basic sub-division is a grouping of the eight inner regular moons , which have nearly circular orbits near the plane of Jupiter equator and are believed to have formed with Jupiter .\nThe remainder of new small outer moons consist of an unknown number of small irregular moons with elliptical and inclined orbits , which are believed to be captured asteroids or fragments of captured asteroids .\nAlong with the Sun , the gravitational influence of Jupiter has helped shape the Solar System .\nThe orbits of most of the Solar System planets lie closer to Jupiter orbital plane than the Sun equatorial plane ( the planet Mercury is the only planet that is closer to the Sun equator in orbital tilt ) , the Kirkwood gaps in the asteroid belt are mostly caused by Jupiter , and the planet 's may have been responsible for the Late Heavy Bombardment of the Solar System history .\nAlong with its moons , Jupiter gravitational field controls numerous asteroids that have settled into the regions of the Lagrangian points preceding and following Jupiter in its orbit around the Sun .\nThese are known as the Trojan asteroids , and are divided into Greek and Trojan '' camps '' to commemorate the Iliad .\nMost short-period comets belong to the Jupiter family defined as comets with semi-major axes smaller than Jupiter .\nJupiter family comets are believed to form in the Kuiper belt outside its .\nDuring close encounters with Jupiter their orbits are perturbed into a smaller period and then circularized by regular gravitational interaction with the Sun and Jupiter .\nJupiter has been called the Solar System vacuum cleaner , because of Jupiter immense gravity well and location near the inner Solar System .\nJupiter receives the most frequent comet impacts of the Solar System planets .\nJupiter was thought that the planet 's served to partially shield the Solar System from cometary bombardment .\nRecent computer simulations suggest that Jupiter does not cause a net decrease in the number of comets that pass through the inner Solar System , as its gravity perturbs their orbits inward in roughly the same numbers that its accretes or ejects Recent computer simulations .\nThis topic remains controversial among astronomers , as some believe This topic draws comets towards A set of new super-Earths from the Kuiper belt while others believe that Jupiter protects A set of new super-Earths from the alleged Oort cloud .\nJupiter experiences about 200 times more asteroid and comet impacts than A set of new super-Earths .\nA 1997 survey of historical astronomical drawings suggested that Cassini may have recorded an impact scar in 1690 .\nThe survey determined eight other candidate observations had low or no possibilities of an impact .\nA fireball was photographed by Voyager 1 during A fireball Jupiter encounter in March 1979 .\nDuring the period July 16 , 1994 , to July 22 , 1994 , over 20 fragments from the comet Shoemaker Levy 9 ( SL9 , formally designated D\\/1993 F2 ) collided with Jupiter southern hemisphere , providing the first direct observation of a collision between two the inner Solar System objects .\nan impact provided useful data on the composition of Jupiter atmosphere .\nThis impact left behind a black spot in Jupiter atmosphere , similar in size to Oval BA .\nInfrared observation showed a bright spot where an impact took place , meaning an impact warmed up the lower atmosphere in the area near Jupiter south pole .\nA fireball , smaller than the previous observed impacts , was detected on June 3 , 2010 , by Anthony Wesley , an amateur astronomer in Australia , and was later discovered to have been captured on video by another amateur astronomer in the Philippines .\nYet another fireball was seen on August 20 , 2010 .\nOn September 10 , 2012 , another fireball was detected .\nIn 1953 , the Miller Urey experiment demonstrated that a combination of lightning and the chemical compounds that existed in the atmosphere of A set of new super-Earths could form organic compounds ( including amino acids ) that could serve as the building blocks of life .\nThe simulated atmosphere included water , methane , ammonia , and molecular hydrogen ; all molecules still found in Jupiter atmosphere .\nJupiter atmosphere has a strong vertical air circulation , which would carry these compounds down into the lower regions .\nThe higher temperatures within the interior of the atmosphere break down these chemicals , which would hinder the formation of Earth-like life .\nIt is considered highly unlikely that there is any Earth-like life on Jupiter , because there is only a small amount of water in Jupiter atmosphere and any possible solid surface deep within Jupiter would be under extreme pressures .\nIn 1976 , before The Pioneer missions , it was hypothesized that ammonia - or water-based life could evolve in Jupiter upper atmosphere .\nThe possible presence of underground oceans on some of Jupiter moons has led to speculation that the presence of life is more likely there .\nJupiter has been known since ancient times .\nJupiter is visible to the naked eye in the night sky and can occasionally be seen in the daytime when the Sun is low .\nTo the Babylonians , this object represented the Babylonians god Marduk .\nthe Babylonians used Jupiter roughly 12-year orbit along the ecliptic to define the constellations of the Babylonians zodiac .\nThe Romans named it after Jupiter ( Latin : Iuppiter , I piter ) ( also called Jove ) , the principal god of Roman mythology , whose name comes from the Proto-Indo-European vocative compound \\* Dy u-p ter ( nominative : \\* Dy us-p t r , meaning '' O Father Sky-God '' , or '' O Father Day-God '' ) .\nIn turn , Jupiter was the counterpart to the mythical Greek Zeus ( ) , also referred to as Dias ( ) , the planetary name of which is retained in modern Greek .\nThe astronomical symbol for the planet 's , , is a stylized representation of the god 's lightning bolt .\nthe mythical Greek Zeus supplies the root zeno - , used to form some Jupiter-related words , such as zenographic .\nJovian is the adjectival form of Jupiter .\nThe older adjectival form jovial , employed by astrologers in the Middle Ages , has come to mean '' happy '' or '' merry , '' moods ascribed to Jupiter astrological influence .\nThe Chinese , Korean and Japanese referred to the planet as the '' wood star '' ( Chinese : ; pinyin : m x ng ) , based on the Chinese Five Elements .\nChinese Taoism personified Chinese Taoism as wood star .\nThe Greeks called Chinese Taoism , Phaethon , '' blazing . ''\nIn Vedic Astrology , Hindu astrologers named the planet 's after Brihaspati , the religious teacher of the gods , and often called the planet 's '' Guru '' , which literally means the '' Heavy One . ''\nIn the English language , Thursday is derived from '' Thor 's day '' , with Thor in Germanic mythology being the equivalent Germanic god to the Roman god Jupiter ( mythology ) .\nThe Roman day Jovis was renamed Thursday .\nIn the Central Asian-Turkic myths , Jupiter called as a '' Erendiz\\/Erent z '' , which means '' eren ( ?\n) + yultuz ( star ) '' .\nAlso , these peoples calculated the period of its as 11 years and 300 days . "

In [79]:
corefOutputParser.count_removed_sents


Out[79]:
30

In [ ]: