Fuzzy string matching algorithm

Directly on the code:

#/usr/bin/python3
# -*- coding=utf8 -*-

import jieba
import MySQLdb




text = "electronic packaging technology, wave propagation and antenna, NBC fire, underwater acoustic engineering, application of electronic technology education, rescue and salvage engineering, radio and TV broadcasts, the rescue headquarters and technology, telecommunications engineering and management, integrated circuit design and integration system, functional materials, electromagnetic fields and wireless technology, micro-electromechanical systems engineering, criminal science and technology, marine engineering, dairy engineering, information engineering, weapons firing engineering, security engineering, special energy technology and engineering, new energy materials and devices, armored vehicles engineering, composite materials and engineering, vehicle maintenance engineering education, water science and technology, ammunition engineering and explosion technology, materials, chemical, food, nutrition and laboratory education, aerospace engineering, environmental and ecological engineering, aircraft engineering, electronic information science and technology, and intelligent building electrical, electronic science and technology, network security and law enforcement, traffic engineering management, spatial information and digital technology, aircraft quality and reliability of urban underground space engineering, resources and environmental science, computer science and technology, information technology confrontation, materials science and engineering, aircraft design and engineering, transport equipment and control engineering, medicine letter Engineering, digital media technology, mining engineering, Detection, Guidance and control technology, food quality and safety, information security, automotive service engineering, vehicle engineering, mineral resources engineering, petroleum engineering, grape and wine engineering, communications engineering, Building Environment and Energy Applications engineering, agricultural engineering, public audio-visual technology, optical information science and engineering, mechanical technology, industrial design, offshore oil and gas engineering, microelectronics science and engineering, agricultural electrification, railway engineering, metallurgical engineering, weapons systems and engineering, mechanical design and manufacturing its automated welding technology and engineering, inorganic non-metallic materials engineering, marine technology, nano-material and technology, aircraft manufacturing engineering, exploration fire, mechanical engineering, agriculture and environmental energy engineering construction, storage and transportation of oil and gas engineering, physical materials, fire engineering, transportation, mechanical and electrical technical education, electrical and computer engineering, aviation technology, environmental engineering, roads and bridges and cross the river engineering, intelligent science and technology, network engineering, food engineering, material forming and control engineering, agricultural engineering, chemical engineering and industrial biotechnology engineering, geological engineering, cooking and nutrition education, software engineering, electronic information engineering, agriculture Mechanization and automation, exploration technology and engineering, metal materials engineering, aircraft airworthiness technology, polymer materials and engineering, water supply and drainage science and engineering, energy, chemical engineering, powder materials science and engineering, environmental science, civil engineering, mechanical electronic engineering, food science and engineering, environmental and life support aircraft engineering, resource recycling science and engineering, Pharmaceutical engineering, resource exploration engineering, environmental science and engineering, landscape architecture, urban planning, nuclear engineering and nuclear technology, radiation protection and nuclear safety, protection of historic buildings engineering, mineral processing engineering, network engineering, groundwater science and engineering, gems and materials technology, wine engineering, water engineering, architecture, traffic engineering, nuclear chemical and nuclear engineering, water conservancy and hydropower engineering, engineering physics, geography circumstances monitoring, navigation, engineering, science and technology of remote sensing, hydrology and water resources engineering, marine electrical and electronic engineering, textile engineering, light and lighting, costume design and technology education, environmental protection equipment engineering, forest engineering, surveying engineering, marine resources development technology, forestry chemical, wood science and engineering, fashion design and engineering, ship and marine engineering, electrical engineering and intelligent control, chemical engineering and technology, marine engineering and technology, nonwoven materials and engineering, energy and environmental systems engineering, new energy science and engineering, Light chemical Engineering, energy and power Engineering, port, waterway and coastal Engineering, printing Engineering, packaging Engineering, theoretical and applied Mechanics, engineering mechanics, orthopedic engineering, bio-pharmaceutical, biomedical engineering, rail traffic signal Control, electrical engineering and automation, smart grid information engineering, chemical biology, molecular science and engineering, chemical, biological engineering, geographic science, paleontology, safety engineering, applied chemistry, geographic information science, human geography and urban planning, geology science, technology and measurement and control instruments, geochemistry, geography and natural resources and the environment, military oceanography, marine science, earth science and information technology, automation, marine technology, nuclear physics, marine resources and the environment, acoustics, physics, ecology, biological sciences, applied physics, geophysics, mathematics and physics sciences, bioinformatics, space science and technology, bio-technology, mathematics and applied mathematics, atmospheric science, astronomy, meteorology applications, information and computer science, psychology, hearing and speech rehabilitation science, optometry, statistics, applied psychology, strong medicine, applied statistics, health inspection and quarantine, Tibetan medicine, stomatology technology, rehabilitation, medical technology experiments, Kazakhstan medicine, medical laboratory technology, Medical Imaging technology, Mongolian medicine, acupuncture and massage, dimensional medical, pharmaceutical preparations, medicine, clinical pharmacy, Tibetan medicine, drug analysis, pharmaceutical management, marine pharmacy, pharmaceutical chemistry, Mongolia Pharmacy, traditional Chinese medicine, pharmacy, traditional Chinese medicine resources and development, medicine, anesthesiology, cultivation and identification of herbal medicine, psychiatry, radiology, optometry and ophthalmology medicine, global health science, maternal and child health medicine, medical imaging, health surveillance, food health and nutrition, preventive medicine, clinical medicine, clinical medicine, forensic medicine, basic medicine, Oral medicine, labor relations, auditing, asset valuation, marketing, education, nursing, financial and accounting education, cultural industries management, urban management, sports economics and management, property management, public relations, international business, customs administration, accounting , traffic management, maritime management, land resources management, management science, business administration, security management, real estate development and management, labor and social security, human resource management, financial management, tourism management and service education, public utilities management, project cost, Exhibition economy and management, archives, administration, library science, information resource management, hotel management, marketing, engineering standardization, quality project management, procurement management, project management, logistics engineering, the development of rural areas, industrial engineering, tobacco, agriculture, forestry, economic management, and e-commerce law, tea, horticulture education, agronomic education, information management and information system, tourism management, application of biological science, plant science and technology, gardening, e-commerce, animal and plant quarantine facility agricultural science and engineering , seed Science and Engineering, animal pharmacy, agriculture, silkworm, plant protection, bee, logistics management, forest protection, forestry, veterinary medicine, marine fisheries Science and technology, animal science, aquatic science and technology, criminology, Aquaculture, garden, school security, water and soil conservation and desertification control, agricultural resources and the environment, wildlife and nature reserve management, anti-drug school, Grassland, Science of Public security, Public security and Information Science, domestic security, finance, criminal investigation, police command and tactics, border management, police dog, police management, fire command, the command of the border, economic crime investigation, international affairs and international relations, diplomacy science, international politics, scientific socialism, political science and public administration, women's studies, prisons, anthropology, home economics, sociology, intellectual property, film studies, ethnology, social work, drama, recording arts, acting, thinking political education, drama, film and television director, animation, film and television drama literature, film and photography and production, drama, film and television art design, radio and television, broadcasting and hosting art, law, public art, arts and crafts, art and technology, art and design school, ceramic art design, sculpture, Chinese painting, digital media arts, design, law books, paintings, clothing and apparel design, environmental design, composing and composing technique theory, experimental art, photography, dance choreographer, School dance, fine arts, music, visual communication design, art history and theory, dance performances, insurance, Musicology, energy economy, investment, financial mathematics, economics and finance, credit management, business economics, financial engineering, resources and environmental economics, foreign police, economic management, finance, trade and economic, Latin, economic statistics, Taxation, German, Mongolian, Russian, Thai, Malay, Hausa, Vietnamese, economics, Danish, French, Norwegian, translation, Finnish, Czech, Poland , Dutch, Japanese, Greek, Swedish, Lao, Esperanto, Icelandic, Persian, Burmese, Zulu, Pashto, international economy and trade, Hindi, Korean, Nepali , Portuguese, English, Bengali, Lithuanian, Tamil, Ukrainian, Kazakh, Maltese, Hungarian, Irish, Sinhala, Urdu, Italian, Filipino, Hebrew Spanish, Sanskrit, Pali, Arabic, Cambodian, Serbian, Turkish, Croatian, Romanian, Estonian, Uzbek, Bulgarian, Swahili, Slovak, Latvian, Turkmen, Catalan, Albanian, Indonesian, Yoruba, Slovenian, classical literature, Chinese language, Secretarial Studies, Chinese ethnic minority language and literature, business English, applied Linguistics, editing and Publishing , communication, digital publishing, advertising, Chinese education, small Education, Chinese International Education, Journalism, cultural education, networking and new media, radio and television science, educational technology, special education, education, rehabilitation, education, preschool education, art education, science education, martial arts and traditional national sports Chinese language and Literature, sports rehabilitation, world history, leisure sports, human movement Science, guidance and management of social sports, archeology, conservation technology, sports training, sports education, logic, ethics, heritage and Museology, foreign language and foreign history, history, religion, philosophy, process equipment and control engineering, airport security checks, aircraft structural repair, air traffic management, aviation engine assembly and test, aircraft electrical and mechanical equipment maintenance, aviation logistics, civil air safety and security, civil aviation transportation, aircraft control equipment and instrumentation, civil aviation special vehicle maintenance, airport management, railway transportation economy, EMU maintenance technology, highway maintenance and management, aircraft maintenance, high-speed railway technology, aerospace electrical and electronic technology, aeronautical communications technology, aviation electrical and mechanical equipment maintenance, road safety and intelligent control, management and application of aviation fuel, road administration, aircraft manufacturing technology, railway post Through operations management, railway vehicles, air crew, construction technology road mechanization, engineering machinery control technology, electrified railway technology, civil aviation business, railway engineering, mechanical engineering and technical services and marketing, high-speed EMU driving, highway engineering management, international shipping business management, engineering and underground tunnel engineering, Aviation security technology management, basic engineering, avionics maintenance, engineering quality supervision and management, construction machinery use and maintenance, road supervision, urban transport, ship outfitting, railway communication signals, railway rolling stock, water supply and drainage engineering, road transport and management, port management and shipping, road and bridge engineering, industrial equipment installation engineering technology, marine engineering technology, customs and international freight forwarding, logistics and port management, port machinery application technology, intelligent building engineering, urban rail transit engineering , landscape engineering, pipeline construction, urban rail transit operations management, architectural engineering technology, heating ventilation and sanitary engineering, construction project management, engineering and technology of ancient Chinese architecture, interior design, pipeline engineering, architectural design technology water industrial technology, mechanical and electrical installation, heating ventilation and air conditioning engineering, waterway engineering, construction and hydropower technology, automotive use of technology, construction management, fire engineering, construction equipment engineering, gem identification and marketing, electrical construction engineering, construction and economic management, urban construction, environmental art design SURVEY land, city gas engineering, Gem Identification and Business, ship machine manufacturing and maintenance, urban management and supervision, vessel inspection, municipal engineering, property, facilities management, project supervision, petroleum geology and exploration technology, coal field geology and exploration technical, port operations management, port logistics equipment and automatic control, hydro-geological and exploration technology, uranium geology and exploration technology, port engineering, container transport management, high-speed railway construction and maintenance technology, highway engineering cost management, pipeline management, rock analysis and identification technology, marine engineering, water management, mining resources development and management, livestock, real estate management and valuation, traffic operation and management, metal mineral geology and exploration technology, gem identification and processing technology, urban rail transit vehicles, non-metallic mineral geology and exploration technology, urban rail traffic control, power engineering management, construction technology, geochemical prospecting, geological information technology, mining and geology, drilling technology, fishery resources and fishery management, geotechnical engineering, engineering geology exploration, mining machinery, sand deposit mining technology, engineering and earthquake engineering survey, geophysical Logging technology, transportation and upgrading mine, hydrological and engineering geology, geophysical exploration technology, environmental engineering geology, nonmetal mining technology, civil engineering testing technology, town planning, mine safety technology and surveillance, mine ventilation and safety, metal mining technology, solid deposits open-pit mining techniques, the metallurgical technology and equipment, the mine measurement, mapping engineering, photogrammetry and Remote Sensing, Engineering measurement and supervision, measurement technology, geodesy and satellite positioning technology, mapping and geological engineering, cadastral mapping and land management information technology, geographic information systems and cartography technology, mapping and geographic information technologies, gas utilization technology, oil and gas mining technology, oil and gas geological exploration technology, drilling technology, oil and gas reservoir analysis technology, oil and gas storage and transportation technology, and geological disaster prevention and control technology, petroleum engineering, mine construction, oil field chemical application technology, coal preparation, mineral processing technology, mineral processing technology, tobacco cultivation technology, tourism and agriculture, coal quality analysis, Orthopedics, tea, plant quarantine, edible and medicinal fungi, herbs cultivation techniques, horticultural technology, medicinal plant cultivation and processing, production and testing of green food, green food production and management, crop production technology, facilities, agricultural technology, seed production and management, agricultural products quality inspection, urban gardens, tea production and processing technology, goods flowers, forest engineering, forest harvesting engineering, forestry, forest vice new product processing, forest resource protection, wildlife conservation, eco-tourism, wild plant resources development and utilization of forest, nature conservation Construction and Management, Chemical Technology Forest, garden technology, regional geological survey and mineral prospecting, wood processing technology, sericulture technology, veterinary medicine, veterinary medicine, veterinary medicine production and marketing, laboratory animal breeding, animal husbandry and veterinary, pet maintenance and disease prevention and control, special animals farming, animal science and technology, township enterprise management, animal epidemic prevention and quarantine, animal feed and animal nutrition, forestry economic information management, administrative management of rural, urban forestry resources and forestry administration, agricultural technology and management, administrative and economic management of rural, agricultural economy management, forestry information engineering and management, urban fisheries, ocean fishing technology, fisheries integrated technology, coal mining technology, aquatic animal and plant protection, aquaculture technology, rehabilitation engineering, medical nutrition, clinical engineering, radiation therapy, Laboratory animal technology , Optometry technology, medical biotechnology, medical beauty technology, respiratory therapy, medical equipment maintenance technology, rehabilitation technology, processing and utilization of coal, health inspection and quarantine technology, medicine identification and quality control technology, electrical and mechanical beneficiation technology, in combined with Western medicine, acupuncture and massage, Victoria medicine, modern medicine technology, medicine, medical secretary, Wei Health information management, public health management, finance, midwifery, taxation, international finance, property transactions and practices, insurance practices, securities and futures, finance, insurance, motor vehicle insurance practice, practice medical insurance, finance and securities, rural cooperative finance, care, securities and investment management, investment and financial management, financial management and practice, project management, asset valuation and management, investment management, Business administration, business management, procurement and supply management, enterprise resource planning, auditing practices, statistical practices, financial information management, accounting and statistical accounting, chain management, pharmaceutical marketing, accounting and auditing, advertising and management, market development and marketing, business management, economic management, drug control, marketing and planning, economic information management, business brokers and agents, investigators, security, border management, accounting, international trade practice, border control, security management, forest fire, police management, information network security supervision, fire management, public security management, border communication and command, security, border boats command, computerized accounting, the police command and tactics, rescue, business staff, border confidential, technical boats, power boats management, military and political work, military financial accounting, criminal technology, musical instruments built technology, military logistics management, motors and electrical appliances, special processing technology, laser processing technology, musical instruments manufacturing technology, precision machinery technology, weapons manufacturing techniques, locks design and technology, aircraft manufacturing technology, furniture design and manufacturing, engine manufacturing and maintenance, steel construction technology, toy design and manufacturing, wire and cable Manufacturing technology, digital technology, management of manufacturing machinery, equipment pharmaceutical manufacturing and maintenance, machine design and manufacturing, welding quality detection techniques, automated machinery and clothing, material forming and control, prosthetics and orthotics design and manufacturing, medical device manufacturing and maintenance, welding technology and automation, missile maintenance, mechanical manufacturing processes and equipment, machinery and quality control and testing technology, mold design and manufacturing, medical electronic engineering, machinery manufacturing and automation, equipment installation technology, medical treatment equipment application technology, logistics engineering technology, computer-aided design and manufacturing, application and maintenance of electrical equipment, metallurgical equipment application and maintenance, management and maintenance of medical imaging equipment, application of automated production equipment, electrical and mechanical equipment maintenance and management, and maintenance of medical equipment, agricultural machinery application technology, motorized car manufacturing and maintenance, NC equipment application and maintenance, automotive plastic technology, car modification technology, automotive marketing and maintenance, vehicle use and maintenance, automotive electronics, industrial network technology, car manufacturing and assembly technology, computer control technology, packaging and automation technology , detection technology and applications, martial arts, elementary education, electricity System automation technology, hydraulic and pneumatic technology, physical and chemical testing and quality control technology, production process automation technology, automotive technology service and marketing, geography education, vehicle inspection and maintenance technology, art education, history education, chemistry education, biology education, children's rehabilitation , music education, electrical automation technology, the crowd rehabilitation, calligraphy education, Russian education, mechatronics, Dance education, education management, Chinese ethnic minority language and culture, physical education, computer education, English education, mathematics education, language education, modern educational technology, traditional sports, laboratory management and teaching, integrated science education, comprehensive liberal arts education, tea culture , psychological counseling and mental health education, Chinese, Russian application, German application, the application Burmese, Japanese application, the application of Thai, Japanese business, tourism Japanese, Lao application, application French, Korean application, application Cambodian, English for Tourism, application Vietnamese, secretarial, Italian applications, libraries and archives management, cultural identification and repair, application of Spanish culture management, application Arabic, English application, operation and management of the cultural market, sports health, social sports, sports, sports service and management, rehabilitation music technology, hearing and speech rehabilitation techniques, river works and management, water management, hydraulic engineering, irrigation and drainage technology, urban water conservancy, water conservancy project supervision, agriculture and irrigation techniques, the port channel and river training works, water conservancy project cost management, electrical and mechanical equipment and irrigation management, water conservancy and hydropower project management, water conservancy and hydropower construction, power station Preparation and management, construction technology hydraulic engineering, hydraulic engineering test and measurement technology, automatic hydrological forecasting technology, equipment and management of hydropower stations, water administration and water resources management, operation and maintenance of mechanical and electrical equipment, information technology, water, fire engineering technology, hydrology and water resources, water environment monitoring and analysis, polymer production techniques, soil conservation, oil refining technology, chemical fiber production technology, protection coating process, organic chemical production technology, production and management direction fireworks, chemical equipment and machinery, fireworks safety and quality technology, chemical equipment maintenance technology, industrial analysis and inspection technology chemicals, fine chemicals production techniques, petrochemical production technology, chemical and biological pharmaceuticals, chemical pharmaceutical technology, biopharmaceutical, Chinese pharmaceutical technology, drug analysis techniques of pharmaceutical formulation , drug business and management, health products development and management, drug quality control technology, technical supervision and inspection, bio-chemical process, food and drug supervision and management, biological experiments, microbiological techniques and applications, dairy technology, winemaking technology, bio-technology and application , fermentation technology, food hygiene inspection, food technology, food processing technology, food biotechnology , Food storage and transportation and marketing, food inspection and management, farm products processing, livestock products processing and testing, food technology and testing, nutrition and food hygiene, food processing and management, grain storage and testing, food analysis and testing, food nutrition and detection, and management of food machinery, textile design, clothing conservation technology, silk technology, modern textile technology, dyeing and weaving art and design, Fashion marketing and management, fashion design, textiles, decorative art and design, taking material design and application of technology clothing, footwear design and technology, new textile mechanical and electrical technology, fashion design and processing, garment and plate-making process, textile inspection and trade, knitting technology and knitted garments, printing, screen technology, publishing and distribution, electronic publishing technology, light industrial products packaging design, publishing information management, printing graphic information processing, layout, editing and proofreading, publishing and computer editing techniques, surface finish finishing process, printing equipment and technology, packaging technology and design, product design and process leather, dyeing and finishing technology, process spice flavors, pulp and paper technology, polymer processing technology, e-government, social assistance, civil administration, land and resources management people's armed forces, public administration, environmental planning and management, public relations, international quality management system certification, inspection technology, social services management welfare, foreign affairs management, stadium management, women's work and management, drug rehabilitation, youth work and management , Housekeeping, community management and service, funeral modern technology and management, community rehabilitation, counseling, career Referral services, elderly services and management, rural electrification technology, scientific and technological achievements intermediary services, chemical plants, power grid monitoring technology, small hydropower stations and power grids, power supply technology, centralized control thermal power plant operation, power transmission engineering, power plants and electricity system, thermal power plant equipment, equipment operation and maintenance of power plants, power management and customer service, high-voltage transmission and distribution construction and operation and maintenance of lines, metallurgy, electric power relay protection and automation, abrasives manufacturing, construction and decoration materials detection system , composite processing and application technology, materials Engineering, jewelry design and technology, material engineering technology, the accelerator reactor, the polymer materials technology, inorganic nonmetallic materials engineering, metal material and heat treatment technology, forensic accounting, energy engineering technology, refrigeration and refrigeration technology, industrial thermal control technology, the Registry, thermal power equipment and applications, rural energy and environmental technology, refrigeration and air conditioning technology, drug-related crimes correction, justice IT, judicial information security, criminal psychological measurement and correction technology, security technology, criminal investigation techniques, forensic technology, the application of the rule of law psychological techniques, Judicial assistants, legal international treaties and conventions customs, judicial police, correctional management, inspection services, economic and legal affairs, legal secretary, prison administration, civil enforcement, administrative enforcement, legal affairs, agricultural environmental protection technology, criminal enforcement, environmental engineering , water environment monitoring and protection, urban water purification technology, environmental monitoring and assessment, resources, environment and urban management, urban testing and engineering, Indoor testing and control technology, rescue technology, information technology and geophysical, environmental monitoring and control technology, atmospheric science and technology, security, technology management, urban emergency rescue decision support technology, environmental protection and industrial safety technology, atmospheric detection technology, technology of Applied Meteorology, lightning protection technology, sound engineering, micro-electronics technology, wireless technology, photonics technology, electric light source technology, information technology, electronic audio-visual technology, intelligent product development, non-destructive testing technology, graphic information technology, information security technology, embedded systems engineering, electronics and process management, broadcast television internet, electronic surface mount technology, electronic product quality inspection, cable television engineering, aircraft electronic assembly technology, electronic technology and measuring instruments, electronic instruments and maintenance, and electronic circuit design process, LCD and photovoltaic technology, electronic information technology and product marketing, electronic equipment and operation management, game software, application of electronic technology, electronic information engineering technology, 3D animation design, network systems management, advertising media development, software testing technology, graphics and video production , computer system maintenance, computer music, computer hardware Peripherals, computer technology and aviation applications, data communications and network systems, software development and project management, site planning and development technology, embedded technology and applications, computer network and security management, software technology, computer information management, communication lines, optical fiber communications, telecommunications business, computer multimedia technology, postal communications, animation design and production, computer communications, satellite digital technology, communication system operation and management, communications network equipment, program-controlled switching technology, communications technology, communications engineering design and management, watch design, identification of painting, art, mobile communications technology, leather goods design, jewelry design, advertising and exhibition, computer network technology, applied art and design, characters design, stage art and design, business image spread, decorative art and design, decorating art design, product design , computer application technology, sculpture art and design, computer art design, art design, sculpture art and furniture design, jewelry craft and identification, multimedia design and production, tourism and handicraft design and production, visual communication art and design, editing, composition techniques, television advertising, audio-visual technology, television camera, journalism and communications, television production Management, film and television animation, advertising design and production, film and television lighting arts, television production, digital media arts, hosted and broadcast, radio and television, photography camera technology, media planning and management, information dissemination and planning, directing, recording technology and art , piano accompaniment, acrobatics, performing arts, film and multimedia technology, news editing and production, piano tuning, models and etiquette,

import jieba.analyse

seg_list = jieba.cut(text, cut_all=True)

word_lst = []
for t in seg_list:
word_lst.append(t)

word_dict = {}
for item in word_lst:
if item not in word_dict:
word_dict[item] = 1
else:
word_dict[item] += 1
word_list_minus9=[]
for w in word_lst:
if word_dict.get(w)<9:
word_list_minus9.append(w)
word_dict_name={}
text_353 = "agricultural facilities and equipment, leisure agriculture, ecological agriculture technology, tobacco cultivation and processing, seed production and management, rural management, forestry, landscape technology, protection of forest resources, resource protection and utilization of wild plants, wildlife conservation and utilization of woodworking equipment application technology, wood processing technology, animal epidemic prevention and quarantine, animal medical laboratory technology, laboratory animal technology, animal feed and animal nutrition, special animal breeding, animal husbandry and engineering technology, sericulture technology, grass industry technology, animal husbandry economic management , marine fisheries technology, science and technology aquarium, aquatic animal medicine, fishery economic management, and management of land resources survey, geological survey and mineral prospecting, geological and mineral exploration, rock and mineral analysis and identification, gem identification and processing, engineering geological survey , hydrology and engineering geology, drilling technology, mining geological, geophysical, geological survey and disaster prevention, environmental engineering geology, geotechnical engineering, engineering measurement technology, engineering surveying, mapping geographic information technology, cadastral mapping and land management , drilling technology, oil and gas mining technology, petroleum engineering, coal mining technology, mining machinery and electrical technology, Mine ventilation and safety, mechanized mining, transportation and upgrading mine, metal and non-metal mining technology, mineral processing technology, environmental monitoring and control technologies, environmental engineering, information technology, environment, environmental planning and management, environmental assessment and consultation services, remediation and ecological engineering technology, clean production and emission reduction technology, safety and health and environmental protection, chemical safety technology, rescue technology, safety technology and management, engineering safety evaluation and supervision, monitoring and control of production safety, occupational health and management, power plants and power systems, power supply technology, mechanical and electrical equipment and automation station, power customer service and management, hydropower stations and power grids, agricultural electrification, micro-grid technology and distributed generation, thermal power plant equipment, thermal power plants centralized control operation, chemical plant and environmental technology, wind power engineering, photovoltaic technology and application, black metallurgy, steel rolling engineering, metallurgical equipment application technology, the quality of metal materials testing, comprehensive utilization of resources of iron ore, nonferrous metallurgy, polymer materials engineering technology, manufacturing a photovoltaic material technology, processing technology carbon, rubber engineering, construction Materials engineering, construction materials testing technology, building decoration materials technology, new building materials technology, architectural design, architectural engineering, ancient architecture engineering, building interiors, rural construction and management, construction engineering, engineering construction equipment, heating ventilation and air conditioning engineering, electrical engineering technology, construction management, project cost, Construction supervision, municipal engineering, urban gas engineering, water supply and drainage engineering, real estate management, property management, hydrology and water resources engineering, hydrological forecasting technology, water administration and water resources management, water conservancy projects, water conservancy and hydropower engineering, water conservancy and hydropower project management, water conservancy and hydropower construction engineering, electrical and mechanical irrigation and drainage engineering, port waterway and river training works, water management, mechanical design and manufacturing, machinery manufacturing and automation, numerical control technology, precision machinery technology, material forming and control technology, welding technology and automation, mechanical product inspection and testing technology, mold design and manufacturing, industrial design, industrial engineering technology, mechanical and electrical equipment maintenance and management, application and maintenance of CNC equipment, refrigeration and air conditioning technology, mechatronics technology, electrical automation technology, intelligent control technology industrial network technology, elevator engineering, industrial robotics, aircraft manufacturing technology, aircraft maintenance technology, applied technology UAV, missile maintenance, automobile manufacturing and assembly technology, vehicle inspection and maintenance technology, automotive electronics, new energy vehicle technology , food biotechnology, chemical biotechnology, pharmaceutical and biological technologies, applications Chemical Technology, petroleum refining technology, petrochemical technology, chemical technology, industrial analysis, chemical automation technology, coal chemical, polymer processing techniques, processes spice flavors, cosmetic technology, the production process of leather, shoes and craft, ceramics manufacturing process, packaging, engineering, planning and packaging design, digital graphic information technology, applied technology printing equipment, digital printing technology, modern textile technology, dyeing and finishing technology, trade and textile testing, textile design, knitting and knitting technology clothing, costume design and technology, food processing technology, wine, food storage and transportation and marketing, food nutrition and health, food nutrition and detection, traditional Chinese medicine production and processing, drug quality and safety, operation and management of drugs, pharmaceutical services and management, cosmetic operations and management, railway locomotives, rolling stock, railway power supply technology, railway engineering, railway signal automatic control, railway communications and information technology, railway traffic operation and management, railway bridge and tunnel engineering, high-speed railway construction technology, high-speed railway passenger crew, EMU maintenance technology, the use of intelligent transportation technology, road and bridge engineering, Road maintenance and management, construction technology road mechanization, vehicle use and maintenance technology, marine technology, international cruise ship crew management, port machinery and auto-control, ports electrical technology, ports and shipping management, marine engineering technology, civil aviation, civil aviation communications technology, airplane driving skills, driving skills helicopters, air crew, airport operations, aircraft electrical and mechanical equipment maintenance, aircraft electronic equipment repair, Urban rail transit vehicle technologies, urban rail transit communication signal technology, urban rail transit operations management, management of postal, courier operations management, electronic information engineering technology, application of electronic technology, micro-electronics technology, intelligent product development, mobile Internet application technology, PV engineering technology, optical display technology, Internet application technology, computer network technology, computer information management, and maintenance of computer systems, software technology, software and information services, animation production technology, embedded technology and applications, digital media technology, information security and management, mobile application development, and application of cloud computing technology, e-commerce technology, communication technology, mobile communication technology, communications engineering design and supervision, optical communication technology, clinical medicine, oral medicine, Chinese medicine, Chinese medicine orthopedics, acupuncture and massage, nursing, pharmacy, pharmacy, medical laboratory technology, medical imaging technology, health inspection and quarantine technology, Optometry technology, radiation therapy, rehabilitation therapy, rehabilitation medicine technology, health information management, population and family development services, reproductive health service and management, health management, nutritional medicine, Chinese medicine health care, psychological counseling, precision Treatment equipment, medical device operation and management, medical equipment maintenance and management, rehabilitation aids, medical equipment application technology, aged care and management, taxation, asset valuation and management, financial management, international finance, insurance, investment and financial management, Internet banking, financial management, accounting, international trade practice, international economy and trade, outsourcing, economic information management, customs clearance and international freight, business brokers and agents, international cultural trade, business management, chain management, marketing, automotive marketing and services, electronic commerce, mobile commerce, Internet marketing, logistics, engineering, logistics, information technology, logistics management, logistics, financial management, project logistics management, cold chain logistics technology and management, procurement and supply management, travel agency management, area development and management, hotel management, restaurant management, cooking technology and nutrition, Western technology, clothing and apparel design, ceramic design and technology, characters design, drama, film and television performances, opera performances, opera performances, musicals, dance performances, choreographer stage art design and production, music, heritage restoration and protection, the network of Journalism and Communication, Publishing business Publishing information management, news editing and production, broadcasting and hosting, film director, film and television animation, photography, video technology, communication and planning, sports training, social sports, leisure sports, golf and sports management, sports operations and management, sports health and rehabilitation, criminal enforcement, administrative enforcement, judicial police, criminal investigation techniques, information technology judicial, judicial information security,
= text_353.split list_353 ( ",")
for YY in list_353:
for ZZ in word_list_minus9:
IF YY ZZ in:
word_dict_name [ZZ] = YY

Print (word_dict)
Print (word_dict_name)

DEF changeMajorName (name, NEW_NAME):
DB = MySQLdb .connect ( "192.168.1.107", "the root", "the root", "LRM", charset = 'UTF8')
# using the cursor () method to get the cursor operation
cursor = db.cursor ()
# using the cursor () method to get operation cursor
SQL = "the UPDATE rank_info the SET name = '" + + NEW_NAME "' the WHERE name = '% S'"% (name)
Print (SQL)
the try:
# execute SQL statements
the cursor.execute (SQL)
# submitted to the database to perform
db .the commit ()
the except:
rollback when an error occurs #
db.rollback ()

# close the connection
db.Close ()
DEF selectName (word_dict_name):

DB = MySQLdb.connect ( "192.168.1.107", "the root", "the root", "LRM", charset = 'UTF8')
# use cursor () method to get the cursor operation
cursor = db.cursor ()
# using the cursor () method to get the cursor operation
SQL = "name the FROM rank_info the SELECT"
list_all_name = []
the try:
# execute SQL statements
the cursor.execute (SQL)
# get a list of all the records
Results = cursor.fetchall ()
for Row Results in:
name = Row [0]
list_all_name.append (name)

return list_all_name
the except:
rollback when an error occurs #
db.rollback()

# Close the connection
db.Close ()
NAME_LIST = selectName (word_dict_name)
KEY_LIST word_dict_name.keys = ()
for LL in NAME_LIST:
for K in KEY_LIST:
IF K in LL:
changeMajorName (LL, word_dict_name [K])
stutter word word segmentation then take part occurrence frequency of less than 9 and the key as needed to match the matching target portion made dict. And modifying the rear part of the database that operates to dict.

Guess you like

Origin www.cnblogs.com/heracles-Mercury/p/12133009.html