Token Search Analyzer - Formatting
Objective
Format the output of the Token Search Analyzer to conform to specific guidelines.
Requirements
- Must pass the Challenge unit tests.
- Output lines must come as close as possible to 80 characters but not exceed 80 characters.
- The first character of output lines must not be a space.
- The last character of output lines must not be a space.
- There must be a blank line between entries.
- The first line of an entry must be the search token, a space, and an equal sign (
=
). Example:expressed =
- The occurrence locations must start on the next line after the search token output line.
- The occurrence location must start with a left square bracket (
[
). - The occurrence location must be followed by a comma and a space except for the last occurrence on a line where it should be just a comma with no space. Example:
345, 123,
- The last occurrence location for an entry must be followed by a right square bracket (
]
). There must not be a space before the bracket. Example:345, 123]
Commit History
Make sure to commit frequently to maintain a clear, well-documented history of your process and progress throughout the challenge.
Examples
Example output file for a small file:
Bartholomew =
[450, 63768, 63797, 64002]
Blacksmith =
[1001, 68511]
Georgiana =
[262, 438, 934, 33580, 33788, 33805, 78414]
expressed =
[870, 14179, 47594, 68017, 80006]
nothinghere =
[]
steeple =
[781]
tombstone =
[174, 799, 882, 1026, 17705]
Example with a larger file:
Bartholomew =
[450, 63768, 63797, 64002, 395387, 1723510, 2507547, 2646013, 2646151, 2946826,
2947341]
Blacksmith =
[1001, 68511, 2760277, 2760280]
Georgiana =
[262, 438, 934, 33580, 33788, 33805, 78414, 108794, 139482, 181544, 185385,
187774, 958622, 958651, 961543, 962019, 962021, 962032, 962092, 962178, 962194,
962204, 962266, 962345, 963232, 963282, 963337, 963345, 963390, 963427, 963455,
963485, 963509, 1008817, 1008830, 1008926, 1009015, 1009498, 1009541, 1009570,
1009616, 1009631, 1009668, 1009730, 1009765, 1009852, 1009866, 1009892, 1010092,
1010165, 1010175, 1010218, 1010240, 1010278, 1010372, 1010407, 1010508, 1010528,
1010552, 1010563, 1010583, 1010621, 1010666, 1010712, 1010835, 1010843, 1011056,
1011092, 1011096, 1011165, 1011989, 1012003, 1012034, 1012078, 1012107, 1012108,
1012140, 1012345, 1012376, 1012378, 1012437, 1012487, 1012546, 1012976, 1013126,
1013350, 1013367, 1013387, 1013441, 1013484, 1013568, 1013570, 1014348, 1015788,
1015789, 1015856, 1015863, 1015877, 1015967, 1016676, 1073151, 1073159, 1074552,
1075027, 1075397, 1075710, 1078884, 1096505, 1131946, 1168038, 1168053, 1168245,
1168381, 1168457, 1168593, 1168676, 1168690, 1168797, 1168945, 1169518]
expressed =
[870, 14179, 47594, 68017, 80006, 98494, 98939, 113545, 113968, 114724, 115190,
116500, 117679, 145056, 146118, 200622, 211995, 232660, 238637, 247456, 261966,
278539, 293511, 293584, 295939, 301689, 324788, 338753, 342545, 358403, 374544,
383715, 384137, 384190, 386810, 396276, 397113, 398622, 454788, 454893, 478076,
485566, 486452, 488778, 500815, 507058, 513914, 522240, 540554, 554269, 559837,
582405, 602316, 612474, 649035, 655492, 668283, 669420, 691023, 700707, 701813,
713434, 720869, 738722, 743885, 752390, 756657, 760173, 760692, 772269, 775840,
775846, 789117, 798905, 803365, 809525, 809907, 810281, 811058, 816580, 824665,
833164, 840073, 844404, 870589, 881902, 891796, 949280, 972903, 988478, 997494,
1000497, 1021496, 1040262, 1045342, 1046038, 1097863, 1102683, 1105463, 1121441,
1138043, 1155604, 1155620, 1155689, 1174974, 1180294, 1187281, 1188355, 1234075,
1248362, 1251204, 1256938, 1283853, 1311203, 1324907, 1325401, 1341935, 1343338,
1343571, 1367542, 1388101, 1392540, 1403731, 1414046, 1431106, 1435382, 1435597,
1446764, 1459193, 1461986, 1462696, 1462745, 1489448, 1490065, 1494800, 1521896,
1522366, 1525010, 1526949, 1531785, 1535398, 1589446, 1598313, 1622093, 1648226,
1660783, 1670602, 1670710, 1685048, 1718958, 1754943, 1760705, 1760818, 1760830,
1775995, 1790277, 1798013, 1798112, 1804897, 1820531, 1825471, 1837698, 1852871,
1858230, 1858648, 1863339, 1863961, 1866623, 1875087, 1896474, 1896620, 1896896,
1898398, 1905033, 1905073, 1906093, 1907863, 1922942, 1929238, 1940126, 1957243,
1958641, 1986039, 1992016, 2032647, 2070053, 2075836, 2081489, 2111740, 2144640,
2153280, 2153441, 2189892, 2190242, 2231461, 2234690, 2234990, 2239147, 2244020,
2245760, 2258999, 2265407, 2268036, 2270088, 2275892, 2275900, 2290739, 2295916,
2309183, 2322743, 2354641, 2362091, 2362690, 2396388, 2399087, 2406292, 2410348,
2411061, 2415879, 2416888, 2435811, 2443690, 2454205, 2458931, 2466614, 2469345,
2476079, 2481094, 2499622, 2509470, 2510239, 2516876, 2518236, 2527480, 2541686,
2548134, 2548507, 2548652, 2569120, 2574428, 2590467, 2594041, 2594705, 2606466,
2610837, 2612583, 2618734, 2650343, 2652573, 2658334, 2663782, 2668657, 2690929,
2699405, 2711574, 2762058, 2843946, 2855412, 2858423, 2859068, 2871737, 2871849,
2881151, 2894446, 2900623, 2923751, 2926880, 2960855, 2962440, 2968680, 2990055,
2997135, 2997231, 3001663, 3004230, 3020123, 3029012, 3030819, 3048359, 3050871,
3063219, 3077503, 3078752, 3085328, 3099477, 3101359, 3116693, 3117464, 3121797,
3167001, 3167701, 3175073, 3209901, 3215235, 3218784, 3228668, 3232536, 3235580,
3243761, 3244537, 3258838, 3314521, 3330852]
nothinghere =
[]
steeple =
[781, 562951, 1113994, 1176813, 1412914, 1493954, 1497034, 1592471, 1626249,
1692950, 2192834, 2373539, 2588547, 2608784, 2753762, 2999354, 3036150, 3063491,
3100885]
tombstone =
[174, 799, 882, 1026, 17705, 110909, 187749, 379282, 379494, 379631, 379954,
380247, 382449, 503401, 1115103, 1339220, 1339858, 1344391, 1743998, 1747451]
And for a really big file that has been abbreviated for display.
Bartholomew =
[450, 63768, 63797, 64002, 395387, 1723510, 2507547, 2646013, 2646151, 2946826,
2947341, 3359114, 3422432, 3422461, 3422666, 3754051, 5082174, 5866211, 6004677,
6004815, 6305490, 6306005, 6717778, 6781096, 6781125, 6781330, 7112715, 8440838,
9224875, 9363341, 9363479, 9664154, 9664669, 10076442, 10139760, 10139789,
10139994, 10471379, 11799502, 12583539, 12722005, 12722143, 13022818, 13023333,
13435106, 13498424, 13498453, 13498658, 13830043, 15158166, 15942203, 16080669,
16080807, 16381482, 16381997]
Blacksmith =
[1001, 68511, 2760277, 2760280, 3359665, 3427175, 6118941, 6118944, 6718329,
6785839, 9477605, 9477608, 10076993, 10144503, 12836269, 12836272, 13435657,
13503167, 16194933, 16194936]
Georgiana =
[262, 438, 934, 33580, 33788, 33805, 78414, 108794, 139482, 181544, 185385,
187774, 958622, 958651, 961543, 962019, 962021, 962032, 962092, 962178, 962194,
962204, 962266, 962345, 963232, 963282, 963337, 963345, 963390, 963427, 963455,
963485, 963509, 1008817, 1008830, 1008926, 1009015, 1009498, 1009541, 1009570,
1009616, 1009631, 1009668, 1009730, 1009765, 1009852, 1009866, 1009892, 1010092,
1010165, 1010175, 1010218, 1010240, 1010278, 1010372, 1010407, 1010508, 1010528,
...
7730769, 7730812, 7730896, 7730898, 7731676, 7733116, 7733117, 7733184, 7733191,
7733205, 7733295, 7734004, 7790479, 7790487, 7791880, 7792355, 7792725, 7793038,
7796212, 7813833, 7849274, 7885366, 7885381, 7885573, 7885709, 7885785, 7885921,
7886004, 7886018, 7886125, 7886273, 7886846, 10076254, 10076430, 10076926,
10109572, 10109780, 10109797, 10154406, 10184786, 10215474, 10257536, 10261377,
10263766, 11034614, 11034643, 11037535, 11038011, 11038013, 11038024, 11038084,
11038170, 11038186, 11038196, 11038258, 11038337, 11039224, 11039274, 11039329,
...
14448226, 14449004, 14450444, 14450445, 14450512, 14450519, 14450533, 14450623,
14451332, 14507807, 14507815, 14509208, 14509683, 14510053, 14510366, 14513540,
14531161, 14566602, 14602694, 14602709, 14602901, 14603037, 14603113, 14603249,
14603332, 14603346, 14603453, 14603601, 14604174]
expressed =
[870, 14179, 47594, 68017, 80006, 98494, 98939, 113545, 113968, 114724, 115190,
116500, 117679, 145056, 146118, 200622, 211995, 232660, 238637, 247456, 261966,
278539, 293511, 293584, 295939, 301689, 324788, 338753, 342545, 358403, 374544,
...
775846, 789117, 798905, 803365, 809525, 809907, 810281, 811058, 816580, 824665,
833164, 840073, 844404, 870589, 881902, 891796, 949280, 972903, 988478, 997494,
1000497, 1021496, 1040262, 1045342, 1046038, 1097863, 1102683, 1105463, 1121441,
1138043, 1155604, 1155620, 1155689, 1174974, 1180294, 1187281, 1188355, 1234075,
...
9576396, 9589065, 9589177, 9598479, 9611774, 9617951, 9641079, 9644208, 9678183,
9679768, 9686008, 9707383, 9714463, 9714559, 9718991, 9721558, 9737451, 9746340,
9748147, 9765687, 9768199, 9780547, 9794831, 9796080, 9802656, 9816805, 9818687,
9834021, 9834792, 9839125, 9884329, 9885029, 9892401, 9927229, 9932563, 9936112,
9945996, 9949864, 9952908, 9961089, 9961865, 9976166, 10031849, 10048180,
10076862, 10090171, 10123586, 10144009, 10155998, 10174486, 10174931, 10189537,
10189960, 10190716, 10191182, 10192492, 10193671, 10221048, 10222110, 10276614,
10287987, 10308652, 10314629, 10323448, 10337958, 10354531, 10369503, 10369576,
...
16512159, 16513408, 16519984, 16534133, 16536015, 16551349, 16552120, 16556453,
16601657, 16602357, 16609729, 16644557, 16649891, 16653440, 16663324, 16667192,
16670236, 16678417, 16679193, 16693494, 16749177, 16765508]
nothinghere =
[]
steeple =
[781, 562951, 1113994, 1176813, 1412914, 1493954, 1497034, 1592471, 1626249,
1692950, 2192834, 2373539, 2588547, 2608784, 2753762, 2999354, 3036150, 3063491,
3100885, 3359445, 3921615, 4472658, 4535477, 4771578, 4852618, 4855698, 4951135,
4984913, 5051614, 5551498, 5732203, 5947211, 5967448, 6112426, 6358018, 6394814,
6422155, 6459549, 6718109, 7280279, 7831322, 7894141, 8130242, 8211282, 8214362,
8309799, 8343577, 8410278, 8910162, 9090867, 9305875, 9326112, 9471090, 9716682,
9753478, 9780819, 9818213, 10076773, 10638943, 11189986, 11252805, 11488906,
11569946, 11573026, 11668463, 11702241, 11768942, 12268826, 12449531, 12664539,
12684776, 12829754, 13075346, 13112142, 13139483, 13176877, 13435437, 13997607,
14548650, 14611469, 14847570, 14928610, 14931690, 15027127, 15060905, 15127606,
15627490, 15808195, 16023203, 16043440, 16188418, 16434010, 16470806, 16498147,
16535541]
tombstone =
[174, 799, 882, 1026, 17705, 110909, 187749, 379282, 379494, 379631, 379954,
380247, 382449, 503401, 1115103, 1339220, 1339858, 1344391, 1743998, 1747451,
3358838, 3359463, 3359546, 3359690, 3376369, 3469573, 3546413, 3737946, 3738158,
3738295, 3738618, 3738911, 3741113, 3862065, 4473767, 4697884, 4698522, 4703055,
5102662, 5106115, 6717502, 6718127, 6718210, 6718354, 6735033, 6828237, 6905077,
7096610, 7096822, 7096959, 7097282, 7097575, 7099777, 7220729, 7832431, 8056548,
8057186, 8061719, 8461326, 8464779, 10076166, 10076791, 10076874, 10077018,
10093697, 10186901, 10263741, 10455274, 10455486, 10455623, 10455946, 10456239,
10458441, 10579393, 11191095, 11415212, 11415850, 11420383, 11819990, 11823443,
13434830, 13435455, 13435538, 13435682, 13452361, 13545565, 13622405, 13813938,
13814150, 13814287, 13814610, 13814903, 13817105, 13938057, 14549759, 14773876,
14774514, 14779047, 15178654, 15182107]
Submission
- Take a screenshot,
searchChallengeTestsPass.png
, showing the Challenge unit tests pass in the console. -
Take two screenshots of the search token output.
- Run the analyzer with the search tokens:
the
,and
,for
, andadsfjdj
. - Take a screenshot of the top portion of the output, name it
searchOutputFormatted.png
. - Save it to the
screenshots/challenges
directory
- Run the analyzer with the search tokens:
-
Push your code to GitHub
- Create an issue and name it "Challenge - Search Output Formatting".
- Reflect on this challenge: Copy the below text and paste it into the "Add a description" textarea.
@kkschumacher
1. What resources did you use to complete this challenge?
2. What does your commit history look like for this challenge? Does it clearly show your process and progress?
3. What obstacles did you overcome?
4. What did you learn by completing this challenge?
Rubric
All of the following must be satisfied to achieve a "Met" status
- Unit Tests: Must pass the Challenge unit tests.
- Screenshots: Screenshots clearly shows expected output and tests passing.
- Debugging & Problem-Solving: Code is free from errors.
- Code Quality: Code is exceptionally clean, efficient, and maintainable. Follows best practices, coding standards, and programming principles.
- Functionality: The output provides is accurate.
- Code Documentation: Proper JavaDoc is used.
- External Sources: External sources (websites, classmates, AI tools, etc), if utilized, are referenced and documented within the code as comments.