Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6746463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:19:33+00:00 2026-05-26T12:19:33+00:00

I am currently visualizing word and phrase frequency across a large database of textual

  • 0

I am currently visualizing word and phrase frequency across a large database of textual information (approximately 108MB spread across 307 text files). My goal is to have a way to quickly see what files are the most relevant and in a visually attractive format (although this project will probably also demonstrate that just having textual representation is always clearer).

Right now I have the following:

SetDirectory["/MYMATHEMATICADIRECTORY/"];
filelist = FileNames[];
viewerCount1 = {0};
viewerCount2 = {0};
word1 = "freedom";
word2 = "liberty";
Do[
  searchDB = StringSplit[Import[filename]];
  AppendTo[viewerCount1, Count[searchDB, word1]];
  AppendTo[viewerCount2, Count[searchDB, word2]];
, {filename, filelist}]

list3 = Take[viewerCount1, {2, -1}]
list4 = Take[viewerCount2, {2, -1}]

The FileNames[ ] generates a list such as: {“001ABbenevolat.txt-cleaned.txt”, “002abnature.txt-cleaned.txt”, “003aboriginaldocs.txt-cleaned.txt”, “004ABpresse.txt-cleaned.txt”, “005acadian.txt-cleaned.txt”, “006acadiedelile.txt-cleaned.txt”,”007acfa.txt-cleaned.txt”} [except with 307 entries, all numbered].

list3 generates a list such as: {0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 100, 2, 0, 0, 0, 10, 1, 7, 0, 0, 0, 0, 23, 3, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 9, 0, 1, 0, 1, 0, 5, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 4, 0, 0, 0, 1, 11, 0, 2, 0, 0, 2, 7, 1, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 13,…} and so on.

The command:

BarChart3D[{list3, list4}, BarSpacing -> {0.5, 0}, ChartLayout -> "Grid"]

Generates something close to what I want (imagining them as file folders sticking up). However, I want to add meaningful tool-tips. By default, it comes up with frequency. Would there be a quick way to also include the filename the frequency is attached to, as well as the frequency? i.e. a tool-tip that brings up ‘007acfa.txt-cleaned.txt — 32’ where 32 occurrences appear in file 7?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:19:33+00:00Added an answer on May 26, 2026 at 12:19 pm

    As an example, suppose you data is something like

    list3 = RandomInteger[30, 30];
    list4 = RandomInteger[30, 30];
    filelist = Table["file " <> ToString[i], {i, 30}];
    

    Then you could do something like

    BarChart3D[{
      MapThread[Tooltip[#2, Row[{#, " -- ", #2}]] &, {filelist, list3}],
      MapThread[Tooltip[#2, Row[{#, " -- ", #2}]] &, {filelist, list4}]}, 
     BarSpacing -> {0.5, 0}, ChartLayout -> "Grid"]
    

    Edit

    Another way is to use LabelingFunction:

    BarChart3D[{list3, list4}, 
     LabelingFunction -> 
      (Placed[Row[{filelist[[Last[#2]]], "  -- ", #1}], Tooltip] &), 
     ChartLayout -> "Grid", BarSpacing -> {0.5, 0}]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently, I am writing a MiddleWare application that synchronizes information between and accounting application
Currently i have a list of sortable elements with a text: How can i
Currently, the only information I have is a one-line error message in the browser's
I am currently working on a GUI software project for visualizing 3D scenes using
Currently I am using HTML files for parts of my user interface. I display
currently, I`m implementing a map App with Mono4Droid and there I`m using a WebView
Currently I'm starting a new Activity and calling finish on a current one. Is
Currently, I'm working on a project where I have a server - client relationship
Currently I have 2 ways of displaying images in a cell, which way will
Currently working with converting SQLException error messages into messages that are more useful for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.