이 생성기를 사용하면 다음에 대한 이름을 생성할 수 있습니다.
random-text-generator.firebaseapp.com에서 사용해 보세요.
생성기가 하는 일은 기본적으로 어떤 문자가 다음에 올 수 있는지 기억하는 것입니다. 생성하는 동안 문자열을 생성하고 비우고 루프에서 새 문자를 예측합니다.
생성기는 어떤 종류의 신경망도 사용하지 않으므로 결과가 논리적으로 의미가 있을 것이라고 기대하지 마십시오. 통계적으로 정확하므로 자연스럽게 보입니다. 지능형 무작위 텍스트 생성기를 찾고 있다면 Brain.js와 같은 신경망 라이브러리를 사용해야 합니다.
문서 전반에 걸쳐 생성기가 characters
로 구성된 words
생성한다고 말하겠지만 걱정하지 마십시오. 텍스트를 생성하려면 문자 대신 단어를 입력하기만 하면 문장을 얻을 수 있습니다.
참고: 일부 예에서 생성된 단어는 이상하게 보일 수 있습니다. 이는 학습 데이터의 양이 충분하지 않기 때문입니다. 더 많은 학습 데이터를 제공할수록 더 나은 결과를 얻을 수 있습니다.
이는 공개 도메인으로 출시된 무료이며 제한이 없는 소프트웨어입니다.
누구든지 이 소프트웨어를 소스 코드 형식이나 컴파일된 바이너리로, 상업적 또는 비상업적 목적과 어떤 수단으로든 자유롭게 복사, 수정, 게시, 사용, 컴파일, 판매 또는 배포할 수 있습니다.
저작권법을 인정하는 관할권에서 이 소프트웨어의 작성자는 소프트웨어에 대한 모든 저작권 이익을 공개 도메인에 바칩니다. 우리는 대중의 이익을 위해 그리고 우리의 상속자와 후계자들에게 손해를 끼치기 위해 이러한 헌신을 합니다. 우리는 이러한 헌신이 저작권법에 따라 이 소프트웨어에 대한 현재 및 미래의 모든 권리를 영구적으로 포기하는 명백한 행위가 되도록 의도합니다.
소프트웨어는 상품성, 특정 목적에의 적합성 및 비침해에 대한 보증을 포함하되 이에 국한되지 않고 명시적이든 묵시적이든 어떠한 종류의 보증 없이 "있는 그대로" 제공됩니다. 어떠한 경우에도 작성자는 소프트웨어나 소프트웨어의 사용 또는 기타 거래로 인해 발생하거나 이와 관련하여 발생하는 계약, 불법 행위 또는 기타 모든 청구, 손해 또는 기타 책임에 대해 책임을 지지 않습니다.
자세한 내용은 https://unlicense.org를 참조하세요.
참고: 포함 구문은 레거시 지원을 제공하기 위해 일시적입니다. 향후 업데이트에서는 변경될 예정입니다.
< script src =" https://raw.githubusercontent.com/Rafal-Majewski/random-text-generator-js/master/random_text_generator_browser.js " > </ script >
npm install random-text-generator
const RandomTextGenerator = require ( "random-text-generator" ) ;
settings
에 표시된 모든 값은 기본값입니다.
// You can change the settings on the fly as well, just write randomTextGenerator.settingName=newValue.
let settings = {
tries : 80 , // That many times the generator will try to generate. If exceeded the generator returns null.
safeMode : true , // Safe mode makes the generation process faster, but makes the output a bit worse.
forceCombiningOrigins : false , // Force the generator to combine origins. See examples for details on origins.
minLength : 1 , // Minimal length (inclusive) of output.
maxLength : 400 , // Maximal length (inclusive) of output.
deepness : 40 , // That many previous characters are used while determining a new character. The greater the generator is more intelligent, but needs more memory.
trust : 2 , // That many times a substring of characters must occur in order to be used while generating.
weightsLeft : { } // Startings weights for generating right -> left.
weightsRight : { } // Startings weights for generating left -> right.
splitter: "" , // A character that is use to split characters. Basically use "" while generating words and " " while generating sentences.
startingCharacter : String . fromCharCode ( 2 ) , // A character that every word starts with. You don't include that in your input examples and it's not included in the generated output.
endingCharacter : String . fromCharCode ( 3 ) , // A character that every word ends with. You don't include that word in your input examples and it's not included in the generated output.
} ;
// Initialize an instance of the generator with custom settings
let randomTextGenerator = new RandomTextGenerator ( settings ) ;
// Or initialize it with the default settings
let randomTextGenerator = new RandomTextGenerator ( ) ;
const RandomTextGenerator = require ( "random-text-generator" ) ;
// Create an instance of the generator with default settings.
let randomTextGenerator = new RandomTextGenerator ( ) ;
// Make an array with some usernames.
let usernames = [ "StinkyPoop" , "Alextron234" , "BattleDash" , "berkey10" , "Ezblox23" , "robiko858" , "zakizakowski" , "MrArtur1337" , "AzisDeus" , "AustrianPainter1889" , "pomidorek2pl" , "JoeMamma" , "MafiaBoss75" , "SciManDan" , "siuras_ogoras986" , "jacob.flix" , "malario" , "BenDrowned" , "pickupthefox" , "okboomer" , "GHPL" , "Firstbober" ] ;
// Pass every username to the generator.
for ( let username of usernames ) randomTextGenerator . learn ( username ) ;
// console.log twelve new nicknames.
for ( let i = 0 ; i < 12 ; ++ i ) {
let username = randomTextGenerator . generate ( ) ;
console . log ( username ) ;
}
// AleDras9
// JoreMamaliky1886
// ziriaBateDeDas_ownkiziMrsDer
// Mrey10
// Ezidoomiskblex
// oeMan
// jan
// Fioomer
// Alox
// GHPaBober
// zakizbi
// Ezakizako889
const RandomTextGenerator = require ( "random-text-generator" ) ;
// Create an instance of the generator with default settings.
let randomTextGenerator = new RandomTextGenerator ( ) ;
let americanCities = [ "New York" , "Los Angeles" , "Chicago" , "Houston" , "Phoenix" , "Philadelphia" , "San Antonio" , "San Diego" , "Dallas" , "San Jose" , "Austin" , "Jacksonville" , "Fort Worth" , "Columbus" , "San Francisco" , "Charlotte" , "Indianapolis" , "Seattle" , "Denver" , "Washington" , "Boston" , "El Paso" , "Detroit" , "Nashville" , "Portland" , "Memphis" , "Oklahoma City" , "Las Vegas" , "Louisville" , "Baltimore" , "Milwaukee" , "Albuquerque" , "Tucson" , "Fresno" , "Mesa" , "Sacramento" , "Atlanta" , "Kansas City" , "Colorado Springs" , "Miami" , "Raleigh" , "Omaha" , "Long Beach" , "Virginia Beach" , "Oakland" , "Minneapolis" , "Tulsa" , "Arlington" , "Tampa" , "New Orleans" , "Wichita" , "Cleveland" , "Bakersfield" , "Aurora" , "Anaheim" , "Honolulu" , "Santa Ana" , "Riverside" , "Corpus Christi" , "Lexington" , "Stockton" , "Henderson" , "Saint Paul" , "St. Louis" , "Cincinnati" , "Pittsburgh" , "Greensboro" , "Anchorage" , "Plano" , "Lincoln" , "Orlando" , "Irvine" , "Newark" , "Toledo" , "Durham" , "Chula Vista" , "Fort Wayne" , "Jersey City" , "St. Petersburg" , "Laredo" , "Madison" , "Chandler" , "Buffalo" , "Lubbock" , "Scottsdale" , "Reno" , "Glendale" , "Gilbert" , "Winston–Salem" , "North Las Vegas" , "Norfolk" , "Chesapeake" , "Garland" , "Irving" , "Hialeah" , "Fremont" , "Boise" , "Richmond" , "Baton Rouge" , "Spokane" , "Des Moines" , "Tacoma" , "San Bernardino" , "Modesto" , "Fontana" , "Santa Clarita" , "Birmingham" , "Oxnard" , "Fayetteville" , "Moreno Valley" , "Rochester" , "Glendale" , "Huntington Beach" , "Salt Lake City" , "Grand Rapids" , "Amarillo" , "Yonkers" , "Aurora" , "Montgomery" , "Akron" , "Little Rock" , "Huntsville" , "Augusta" , "Port St. Lucie" , "Grand Prairie" , "Columbus" , "Tallahassee" , "Overland Park" , "Tempe" , "McKinney" , "Mobile" , "Cape Coral" , "Shreveport" , "Frisco" , "Knoxville" , "Worcester" , "Brownsville" , "Vancouver" , "Fort Lauderdale" , "Sioux Falls" , "Ontario" , "Chattanooga" , "Providence" , "Newport News" , "Rancho Cucamonga" , "Santa Rosa" , "Oceanside" , "Salem" , "Elk Grove" , "Garden Grove" , "Pembroke Pines" , "Peoria" , "Eugene" , "Corona" , "Cary" , "Springfield" , "Fort Collins" , "Jackson" , "Alexandria" , "Hayward" , "Lancaster" , "Lakewood" , "Clarksville" , "Palmdale" , "Salinas" , "Springfield" , "Hollywood" , "Pasadena" , "Sunnyvale" , "Macon" , "Kansas City" , "Pomona" , "Escondido" , "Killeen" , "Naperville" , "Joliet" , "Bellevue" , "Rockford" , "Savannah" , "Paterson" , "Torrance" , "Bridgeport" , "McAllen" , "Mesquite" , "Syracuse" , "Midland" , "Pasadena" , "Murfreesboro" , "Miramar" , "Dayton" , "Fullerton" , "Olathe" , "Orange" , "Thornton" , "Roseville" , "Denton" , "Waco" , "Surprise" , "Carrollton" , "West Valley City" , "Charleston" , "Warren" , "Hampton" , "Gainesville" , "Visalia" , "Coral Springs" , "Columbia" , "Cedar Rapids" , "Sterling Heights" , "New Haven" , "Stamford" , "Concord" , "Kent" , "Santa Clara" , "Elizabeth" , "Round Rock" , "Thousand Oaks" , "Lafayette" , "Athens" , "Topeka" , "Simi Valley" , "Fargo" , "Norman" , "Columbia" , "Abilene" , "Wilmington" , "Hartford" , "Victorville" , "Pearland" , "Vallejo" , "Ann Arbor" , "Berkeley" , "Allentown" , "Richardson" , "Odessa" , "Arvada" , "Cambridge" , "Sugar Land" , "Beaumont" , "Lansing" , "Evansville" , "Rochester" , "Independence" , "Fairfield" , "Provo" , "Clearwater" , "College Station" , "West Jordan" , "Carlsbad" , "El Monte" , "Murrieta" , "Temecula" , "Springfield" , "Palm Bay" , "Costa Mesa" , "Westminster" , "North Charleston" , "Miami Gardens" , "Manchester" , "High Point" , "Downey" , "Clovis" , "Pompano Beach" , "Pueblo" , "Elgin" , "Lowell" , "Antioch" , "West Palm Beach" , "Peoria" , "Everett" , "Ventura" , "Centennial" , "Lakeland" , "Gresham" , "Richmond" , "Billings" , "Inglewood" , "Broken Arrow" , "Sandy Springs" , "Jurupa Valley" , "Hillsboro" , "Waterbury" , "Santa Maria" , "Boulder" , "Greeley" , "Daly City" , "Meridian" , "Lewisville" , "Davie" , "West Covina" , "League City" , "Tyler" , "Norwalk" , "San Mateo" , "Green Bay" , "Wichita Falls" , "Sparks" , "Lakewood" , "Burbank" , "Rialto" , "Allen" , "El Cajon" , "Las Cruces" , "Renton" , "Davenport" , "South Bend" , "Vista" , "Tuscaloosa" , "Clinton" , "Edison" , "Woodbridge" , "San Angelo" , "Kenosha" , "Vacaville" ] ;
let polishCities = [ "Warszawa" , "Kraków" , "Łódź" , "Wrocław" , "Poznań" , "Gdańsk" , "Szczecin" , "Bydgoszcz" , "Lublin" , "Białystok" , "Katowice" , "Gdynia" , "Częstochowa" , "Radom" , "Toruń" , "Sosnowiec" , "Kielce,Rzeszów" , "Gliwice" , "Zabrze" , "Olsztyn" , "Bielsko-Biała" , "Bytom" , "Zielona Góra" , "Rybnik" , "Ruda Śląska" , "Opole" , "Tychy" , "Gorzów Wielkopolski" , "Płock" , "Dąbrowa Górnicza" , "Elbląg" , "Wałbrzych" , "Włocławek" , "Tarnów" , "Chorzów" , "Koszalin" , "Kalisz" ]
// Teach the generator the names of the cities, but preserve its origin.
for ( let americanCity of americanCities ) randomTextGenerator . learn ( americanCity , "americanCity" ) ;
for ( let polishCity of polishCities ) randomTextGenerator . learn ( polishCity , "polishCity" ) ;
// console.log twelve new city names.
for ( let i = 0 ; i < 12 ; ++ i ) {
// randomTextGenerator.generate(text, origins, isRaw);
// we are going to leave the "text" field null, because we don't want any specific characters at the beginning.
// origins is an array where you can specify the origins you want the generator to generate from, in this case you can leave it as null, because by default the generator uses all origins
let city = randomTextGenerator . generate ( null , [ "polishCity" , "americanCity" ] ) ; //
console . log ( city ) ;
}
// San Jortisvina
// Mouleghornówek
// Glea
// Fa
// Hinicesalmaiorolisz
// Sangandbrzea
// Watins Clencin
// Bakevilente
// Worte
// Daberainghanderg
// Ork
// Sa
// The output should contain features of both training datasets.
const RandomTextGenerator = require ( "random-text-generator" ) ;
// Create an instance of the generator. Because you want to generate a text you should set the splitter to " " and use a smaller deepness that the default 40 (to save memory and training time). In this case the deepness says how many of previous words determine the following words.
let randomTextGenerator = new RandomTextGenerator ( { splitter : " " , deepness : 8 } ) ;
// Make a string with a long text. Source: https://en.wikipedia.org/wiki/Nineteen_Eighty-Four.
let exemplaryText = `Nineteen Eighty-Four: A Novel, often published as 1984, is a dystopian novel by English novelist George Orwell. It was published in June 1949 by Secker & Warburg as Orwell's ninth and final book completed in his lifetime. The story was mostly written at Barnhill, a farmhouse on the Scottish island of Jura, at times while Orwell suffered from severe tuberculosis. Thematically, Nineteen Eighty-Four centres on the consequences of government over-reach, totalitarianism, and repressive regimentation of all persons and behaviours within society. The story takes place in an imagined future, the year 1984, when much of the world has fallen victim to perpetual war, omnipresent government surveillance, historical negationism and propaganda. Great Britain, known as Airstrip One, has become a province of a superstate named Oceania that is ruled by the Party who employ the Thought Police to persecute individuality and independent thinking. Big Brother, the leader of the Party, enjoys an intense cult of personality despite the fact that he may not even exist. The protagonist, Winston Smith, is a diligent and skilful rank-and-file worker and Party member who secretly hates the Party and dreams of rebellion. He enters a forbidden relationship with a co-worker, Julia. Nineteen Eighty-Four has become a classic literary example of political and dystopian fiction. Many terms used in the novel have entered common usage, including Big Brother, doublethink, thoughtcrime, Newspeak, Room 101, telescreen, 2 + 2 = 5, prole, and memory hole. Nineteen Eighty-Four also popularised the adjective "Orwellian", connoting things such as official deception, secret surveillance, brazenly misleading terminology, and manipulation of recorded history by a totalitarian or authoritarian state. Time included it on its one hundred best English-language novels from 1923 to 2005. It was placed on the Modern Library's 100 Best Novels, reaching No. 13 on the editors' list and No. 6 on the readers' list. In 2003, the novel was listed at No. 8 on The Big Read survey by the BBC. Parallels have been drawn between the novel's subject matter and real life instances of totalitarianism, mass surveillance, and violations of freedom of expression among other themes.` ;
// Pass the exemplaryText to the generator. You should split it at first, because it is a text.
randomTextGenerator . learn ( exemplaryText . split ( " " ) ) ;
// console.log the generated Lorem Ipsum
console . log ( randomTextGenerator . generate ( ) ) ;
// Nineteen Eighty-Four: A Novel, often published as 1984, is a dystopian fiction. Many terms used in the Scottish island of rebellion. He enters a dystopian fiction. Many terms used in June 1949 by Secker & Warburg as 1984, when much of a co-worker, Julia. Nineteen Eighty-Four has become a classic literary example of Jura, at Barnhill, a dystopian novel by Secker & Warburg as Airstrip One, has fallen victim to perpetual war, omnipresent government over-reach, totalitarianism, and memory hole. Nineteen Eighty-Four has become a classic literary example of all persons and final book completed in an imagined future, the adjective "Orwellian", connoting things such as Airstrip One, has become a province of political and skilful rank-and-file worker and Party who secretly hates the Scottish island of totalitarianism, mass surveillance, and propaganda. Great Britain, known as 1984, when much of freedom of totalitarianism, and real life instances of a province of rebellion. He enters a classic literary example of political and real life instances of all persons and dreams of totalitarianism, and propaganda. Great Britain, known as 1984, when much of totalitarianism, mass surveillance, historical negationism and repressive regimentation of freedom of freedom of all persons and Party who employ the consequences of recorded history by a dystopian novel was published in the Scottish island of rebellion. He enters a dystopian novel have entered common usage, including Big Brother, the leader of Jura, at times while Orwell suffered from 1923 to persecute individuality and independent thinking. Big Brother, the BBC. Parallels have been drawn between the year 1984, when much of political and independent thinking. Big Brother, doublethink, thought